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

Unified Diff: frog/frogsh

Issue 8567010: Dynamically dispatch getters and setters on dynamically-typed variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes, frogsh Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | frog/member.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/frogsh
diff --git a/frog/frogsh b/frog/frogsh
index 3b22f38db0a2ac8cac2727149a690e2f46fd57fd..1558b47b247dcd77e5ea0c72f2e43fcd7e493d1d 100755
--- a/frog/frogsh
+++ b/frog/frogsh
@@ -432,6 +432,12 @@ Object.prototype.expectedType$1 = function($0) {
Object.prototype.filter$1 = function($0) {
return this.noSuchMethod("filter", [$0]);
};
+Object.prototype.findTypeByName$1 = function($0) {
+ return this.noSuchMethod("findTypeByName", [$0]);
+};
+Object.prototype.forEach$1 = function($0) {
+ return this.noSuchMethod("forEach", [$0]);
+};
Object.prototype.genValue$2 = function($0, $1) {
return this.noSuchMethod("genValue", [$0, $1]);
};
@@ -444,6 +450,9 @@ Object.prototype.generateBody$2 = function($0, $1) {
Object.prototype.getBeginToken$0 = function() {
return this.noSuchMethod("getBeginToken", []);
};
+Object.prototype.getColumn$2 = function($0, $1) {
+ return this.noSuchMethod("getColumn", [$0, $1]);
+};
Object.prototype.getConstructor$1 = function($0) {
return this.noSuchMethod("getConstructor", [$0]);
};
@@ -456,6 +465,9 @@ Object.prototype.getFactory$2 = function($0, $1) {
Object.prototype.getKeys$0 = function() {
return this.noSuchMethod("getKeys", []);
};
+Object.prototype.getLine$1 = function($0) {
+ return this.noSuchMethod("getLine", [$0]);
+};
Object.prototype.getMember$1 = function($0) {
return this.noSuchMethod("getMember", [$0]);
};
@@ -1340,6 +1352,8 @@ ListFactory.prototype.is$List = function(){return this;};
ListFactory.prototype.is$List$ArgumentNode = function(){return this;};
ListFactory.prototype.is$List$Definition = function(){return this;};
ListFactory.prototype.is$List$EvaluatedValue = function(){return this;};
+ListFactory.prototype.is$List$HInstruction = function(){return this;};
+ListFactory.prototype.is$List$Member = function(){return this;};
ListFactory.prototype.is$List$String = function(){return this;};
ListFactory.prototype.is$List$Type = function(){return this;};
ListFactory.prototype.is$List$Value = function(){return this;};
@@ -1391,6 +1405,7 @@ ListFactory.prototype.addAll$1 = function($0) {
return this.addAll(($0 && $0.is$Collection$E()));
};
ListFactory.prototype.filter$1 = ListFactory.prototype.filter;
+ListFactory.prototype.forEach$1 = ListFactory.prototype.forEach;
ListFactory.prototype.indexOf$2 = ListFactory.prototype.indexOf;
ListFactory.prototype.isEmpty$0 = function() {
return this.isEmpty();
@@ -1548,6 +1563,7 @@ ImmutableMap.prototype.containsKey = function(key) {
ImmutableMap.prototype.$setindex = function(key, value) {
$throw(const$12/*const IllegalAccessException()*/);
}
+ImmutableMap.prototype.forEach$1 = ImmutableMap.prototype.forEach;
ImmutableMap.prototype.getKeys$0 = function() {
return this.getKeys();
};
@@ -1802,6 +1818,7 @@ HashMapImplementation.prototype.getValues = function() {
HashMapImplementation.prototype.containsKey = function(key) {
return (this._probeForLookup(key) != -1);
}
+HashMapImplementation.prototype.forEach$1 = HashMapImplementation.prototype.forEach;
HashMapImplementation.prototype.getKeys$0 = function() {
return this.getKeys();
};
@@ -2032,6 +2049,7 @@ HashSetImplementation.prototype.addAll$1 = function($0) {
};
HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.contains;
HashSetImplementation.prototype.filter$1 = HashSetImplementation.prototype.filter;
+HashSetImplementation.prototype.forEach$1 = HashSetImplementation.prototype.forEach;
HashSetImplementation.prototype.isEmpty$0 = function() {
return this.isEmpty();
};
@@ -2143,7 +2161,7 @@ LinkedHashMapImplementation.prototype.is$Map$Node$Element = function(){return th
LinkedHashMapImplementation.prototype.is$Map$String$Member = function(){return this;};
LinkedHashMapImplementation.prototype.$setindex = function(key, value) {
if (this._map.containsKey(key)) {
- this._map.$index(key).get$element().value = value;
+ this._map.$index(key).get$element().set$value(value);
}
else {
this._list.addLast(new KeyValuePair$K$V(key, value));
@@ -2194,6 +2212,7 @@ Object.defineProperty(LinkedHashMapImplementation.prototype, "length", {
LinkedHashMapImplementation.prototype.isEmpty = function() {
return this.get$length() == 0;
}
+LinkedHashMapImplementation.prototype.forEach$1 = LinkedHashMapImplementation.prototype.forEach;
LinkedHashMapImplementation.prototype.getKeys$0 = function() {
return this.getKeys();
};
@@ -2385,15 +2404,17 @@ DoubleLinkedQueue.prototype.isEmpty = function() {
DoubleLinkedQueue.prototype.forEach = function(f) {
var entry = this._sentinel._next;
while (entry !== this._sentinel) {
+ var nextEntry = entry._next;
f(entry._element);
- entry = entry._next;
+ entry = nextEntry;
}
}
DoubleLinkedQueue.prototype.some = function(f) {
var entry = this._sentinel._next;
while (entry !== this._sentinel) {
+ var nextEntry = entry._next;
if (f(entry._element)) return true;
- entry = entry._next;
+ entry = nextEntry;
}
return false;
}
@@ -2401,8 +2422,9 @@ DoubleLinkedQueue.prototype.filter = function(f) {
var other = new DoubleLinkedQueue();
var entry = this._sentinel._next;
while (entry !== this._sentinel) {
+ var nextEntry = entry._next;
if (f(entry._element)) other.addLast(entry._element);
- entry = entry._next;
+ entry = nextEntry;
}
return other;
}
@@ -2414,6 +2436,7 @@ DoubleLinkedQueue.prototype.addAll$1 = function($0) {
return this.addAll(($0 && $0.is$Collection$E()));
};
DoubleLinkedQueue.prototype.filter$1 = DoubleLinkedQueue.prototype.filter;
+DoubleLinkedQueue.prototype.forEach$1 = DoubleLinkedQueue.prototype.forEach;
DoubleLinkedQueue.prototype.isEmpty$0 = function() {
return this.isEmpty();
};
@@ -2460,8 +2483,9 @@ DoubleLinkedQueue$KeyValuePair$K$V.prototype.lastEntry = function() {
DoubleLinkedQueue$KeyValuePair$K$V.prototype.forEach = function(f) {
var entry = this._sentinel._next;
while (entry !== this._sentinel) {
+ var nextEntry = entry._next;
f(entry._element);
- entry = entry._next;
+ entry = nextEntry;
}
}
// ********** Code for DoubleLinkedQueue$SourceString **************
@@ -2519,6 +2543,9 @@ StopwatchImplementation.prototype.start = function() {
this._start = Clock.now() - (this._stop - this._start);
}
}
+StopwatchImplementation.prototype.get$start = function() {
+ return StopwatchImplementation.prototype.start.bind(this);
+}
StopwatchImplementation.prototype.stop = function() {
if (this._start == null) {
return;
@@ -2731,9 +2758,10 @@ DateImplementation.now$ctor.prototype = DateImplementation.prototype;
DateImplementation.prototype.is$Date = function(){return this;};
DateImplementation.prototype.is$Comparable = function(){return this;};
DateImplementation.prototype.get$value = function() { return this.value; };
+DateImplementation.prototype.get$timeZone = function() { return this.timeZone; };
DateImplementation.prototype.$eq = function(other) {
if (!((other instanceof DateImplementation))) return false;
- return (this.value == other.get$value()) && ($eq(this.timeZone, other.timeZone));
+ return (this.value == other.get$value()) && ($eq(this.timeZone, other.get$timeZone()));
}
DateImplementation.prototype.compareTo = function(other) {
return this.value.compareTo(other.value);
@@ -2815,12 +2843,13 @@ TimeZoneImplementation.local$ctor = function() {
TimeZoneImplementation.local$ctor.prototype = TimeZoneImplementation.prototype;
TimeZoneImplementation.prototype.$eq = function(other) {
if (!((other instanceof TimeZoneImplementation))) return false;
- return $eq(this.isUtc, other.isUtc);
+ return $eq(this.isUtc, other.get$isUtc());
}
TimeZoneImplementation.prototype.toString = function() {
if ($notnull_bool(this.isUtc)) return "TimeZone (UTC)";
return "TimeZone (Local)";
}
+TimeZoneImplementation.prototype.get$isUtc = function() { return this.isUtc; };
TimeZoneImplementation.prototype.toString$0 = function() {
return this.toString();
};
@@ -3152,7 +3181,7 @@ ArrayBasedScanner.prototype.appendBeginGroup = function(kind, value) {
var token = new BeginGroupToken(kind, value, this.tokenStart);
this.tail.next = token;
this.tail = this.tail.next;
- while (kind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmpty()) && this.groupingStack.get$head().kind === 60/*null.LT_TOKEN*/) {
+ while (kind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmpty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
this.groupingStack = (($0 = this.groupingStack.prepend(token)) && $0.is$Link$Token());
@@ -3165,14 +3194,14 @@ ArrayBasedScanner.prototype.appendEndGroup = function(kind, value, openKind) {
if (openKind === 60/*null.LT_TOKEN*/) return;
$throw(new MalformedInputException(('Unmatched ' + value + '')));
}
- while (openKind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmpty()) && this.groupingStack.get$head().kind === 60/*null.LT_TOKEN*/) {
+ while (openKind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmpty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
- if (this.groupingStack.get$head().kind !== openKind) {
+ if (this.groupingStack.get$head().get$kind() !== openKind) {
if (openKind === 60/*null.LT_TOKEN*/) return;
$throw(new MalformedInputException(('Unmatched ' + value + '')));
}
- this.groupingStack.get$head().endGroup = oldTail.next;
+ this.groupingStack.get$head().set$endGroup(oldTail.next);
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
ArrayBasedScanner.prototype.appendGtGt = function(kind, value) {
@@ -3180,12 +3209,12 @@ ArrayBasedScanner.prototype.appendGtGt = function(kind, value) {
var oldTail = this.tail;
this.appendStringToken(kind, value);
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
- this.groupingStack.get$head().endGroup = oldTail.next;
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
+ this.groupingStack.get$head().set$endGroup(oldTail.next);
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
}
@@ -3194,16 +3223,16 @@ ArrayBasedScanner.prototype.appendGtGtGt = function(kind, value) {
var oldTail = this.tail;
this.appendStringToken(kind, value);
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
- this.groupingStack.get$head().endGroup = oldTail.next;
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
+ this.groupingStack.get$head().set$endGroup(oldTail.next);
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
}
@@ -3262,7 +3291,7 @@ ArrayBasedScanner$SourceString.prototype.appendBeginGroup = function(kind, value
var token = new BeginGroupToken(kind, value, this.tokenStart);
this.tail.next = token;
this.tail = this.tail.next;
- while (kind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmpty()) && this.groupingStack.get$head().kind === 60/*null.LT_TOKEN*/) {
+ while (kind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmpty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
this.groupingStack = (($0 = this.groupingStack.prepend(token)) && $0.is$Link$Token());
@@ -3275,14 +3304,14 @@ ArrayBasedScanner$SourceString.prototype.appendEndGroup = function(kind, value,
if (openKind === 60/*null.LT_TOKEN*/) return;
$throw(new MalformedInputException(('Unmatched ' + value + '')));
}
- while (openKind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmpty()) && this.groupingStack.get$head().kind === 60/*null.LT_TOKEN*/) {
+ while (openKind !== 60/*null.LT_TOKEN*/ && !$notnull_bool(this.groupingStack.isEmpty()) && this.groupingStack.get$head().get$kind() === 60/*null.LT_TOKEN*/) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
- if (this.groupingStack.get$head().kind !== openKind) {
+ if (this.groupingStack.get$head().get$kind() !== openKind) {
if (openKind === 60/*null.LT_TOKEN*/) return;
$throw(new MalformedInputException(('Unmatched ' + value + '')));
}
- this.groupingStack.get$head().endGroup = oldTail.next;
+ this.groupingStack.get$head().set$endGroup(oldTail.next);
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
ArrayBasedScanner$SourceString.prototype.appendGtGt = function(kind, value) {
@@ -3290,12 +3319,12 @@ ArrayBasedScanner$SourceString.prototype.appendGtGt = function(kind, value) {
var oldTail = this.tail;
this.appendStringToken(kind, value);
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
- this.groupingStack.get$head().endGroup = oldTail.next;
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
+ this.groupingStack.get$head().set$endGroup(oldTail.next);
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
}
@@ -3304,16 +3333,16 @@ ArrayBasedScanner$SourceString.prototype.appendGtGtGt = function(kind, value) {
var oldTail = this.tail;
this.appendStringToken(kind, value);
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
if ($notnull_bool(this.groupingStack.isEmpty())) return;
- if ($notnull_bool($eq(this.groupingStack.get$head().kind, 60/*null.LT_TOKEN*/))) {
- this.groupingStack.get$head().endGroup = oldTail.next;
+ if ($notnull_bool($eq(this.groupingStack.get$head().get$kind(), 60/*null.LT_TOKEN*/))) {
+ this.groupingStack.get$head().set$endGroup(oldTail.next);
this.groupingStack = (($0 = this.groupingStack.get$tail()) && $0.is$Link$Token());
}
}
@@ -5949,7 +5978,7 @@ PartialParser.prototype.isIdentifier = function(token) {
case kind === 107/*null.KEYWORD_TOKEN*/:
- return token.get$value().isPseudo;
+ return $assert_bool(token.get$value().get$isPseudo());
default:
@@ -5973,8 +6002,9 @@ PartialParser.prototype.parseFactoryClauseOpt = function(token) {
return token;
}
PartialParser.prototype.skipBlock = function(token) {
+ var $0;
if (!$notnull_bool(this.optional('{', token))) {
- return this.listener.expectedBlock$1(token);
+ return (($0 = this.listener.expectedBlock$1(token)) && $0.is$Token());
}
var beginGroupToken = (token && token.is$BeginGroupToken());
$assert(beginGroupToken.endGroup == null || beginGroupToken.endGroup.kind === 125/*null.$RBRACE*/, "beginGroupToken.endGroup === null ||\n beginGroupToken.endGroup.kind === $RBRACE", "parser.dart", 171, 12);
@@ -6036,6 +6066,7 @@ PartialParser.prototype.parseIdentifier = function(token) {
return this.next(token);
}
PartialParser.prototype.expect = function(string, token) {
+ var $0;
if (string !== token.get$stringValue()) {
if (string === '>') {
if (token.get$stringValue() === '>>') {
@@ -6049,7 +6080,7 @@ PartialParser.prototype.expect = function(string, token) {
return gtgt;
}
}
- return this.listener.expected$2(string, token);
+ return (($0 = this.listener.expected$2(string, token)) && $0.is$Token());
}
return token.next;
}
@@ -6069,6 +6100,7 @@ PartialParser.prototype.optional = function(value, token) {
return value === token.get$stringValue();
}
PartialParser.prototype.parseType = function(token) {
+ var $0;
var begin = token;
var identifierCount = 1;
if ($notnull_bool(this.isIdentifier(token))) {
@@ -6084,7 +6116,7 @@ PartialParser.prototype.parseType = function(token) {
return this.next(token);
}
else {
- token = this.listener.expectedType$1(token);
+ token = (($0 = this.listener.expectedType$1(token)) && $0.is$Token());
}
token = this.parseTypeArgumentsOpt(token);
this.listener.endType$3(identifierCount, begin, token);
@@ -6122,6 +6154,7 @@ PartialParser.prototype.parseClassBody = function(token) {
return this.skipBlock(token);
}
PartialParser.prototype.parseTopLevelMember = function(token) {
+ var $0;
var start = token;
this.listener.beginTopLevelMember$1(token);
var previous = token;
@@ -6156,7 +6189,7 @@ PartialParser.prototype.parseTopLevelMember = function(token) {
break;
}
else {
- token = this.listener.unexpected$1(token);
+ token = (($0 = this.listener.unexpected$1(token)) && $0.is$Token());
}
}
if (!$notnull_bool(isField)) {
@@ -7629,6 +7662,7 @@ function SubstringWrapper(internalString, begin, end) {
// Initializers done
}
SubstringWrapper.prototype.is$SourceString = function(){return this;};
+SubstringWrapper.prototype.get$end = function() { return this.end; };
SubstringWrapper.prototype.hashCode = function() {
return this.toString().hashCode();
}
@@ -7660,6 +7694,7 @@ function Token(kind, charOffset) {
// Initializers done
}
Token.prototype.is$Token = function(){return this;};
+Token.prototype.get$kind = function() { return this.kind; };
Token.prototype.get$charOffset = function() { return this.charOffset; };
Token.prototype.get$value = function() {
return const$234/*const SourceString('EOF')*/;
@@ -7752,6 +7787,8 @@ function BeginGroupToken(kind, value, charOffset) {
}
$inherits(BeginGroupToken, StringToken);
BeginGroupToken.prototype.is$BeginGroupToken = function(){return this;};
+BeginGroupToken.prototype.get$endGroup = function() { return this.endGroup; };
+BeginGroupToken.prototype.set$endGroup = function(value) { return this.endGroup = value; };
// ********** Code for Keyword **************
function Keyword(syntax, isPseudo) {
this.syntax = syntax;
@@ -7759,6 +7796,8 @@ function Keyword(syntax, isPseudo) {
// Initializers done
}
Keyword.prototype.is$SourceString = function(){return this;};
+Keyword.prototype.get$syntax = function() { return this.syntax; };
+Keyword.prototype.get$isPseudo = function() { return this.isPseudo; };
Keyword.get$keywords = function() {
if (Keyword._keywords == null) {
Keyword._keywords = Keyword.computeKeywordMap();
@@ -7805,7 +7844,7 @@ KeywordState.get$KEYWORD_STATE = function() {
var strings = new ListFactory(const$232/*Keyword.values*/.get$length());
for (var i = 0;
i < const$232/*Keyword.values*/.get$length(); i++) {
- strings.$setindex(i, const$232/*Keyword.values*/[i].syntax);
+ strings.$setindex(i, const$232/*Keyword.values*/[i].get$syntax());
}
strings.sort((function (a, b) {
return a.compareTo$1(b);
@@ -7823,7 +7862,7 @@ KeywordState.computeKeywordStateTable = function(start, strings, offset, length)
for (var i = offset;
i < offset + length; i++) {
if (strings.$index(i).length > start) {
- var c = strings.$index(i).charCodeAt$1(start);
+ var c = $assert_num(strings.$index(i).charCodeAt$1(start));
if (chunk != c) {
if (chunkStart != -1) {
result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordStateTable(start + 1, strings, chunkStart, i - chunkStart));
@@ -8105,6 +8144,7 @@ function Block(statements) {
// Initializers done
}
$inherits(Block, Statement);
+Block.prototype.get$statements = function() { return this.statements; };
Block.prototype.accept = function(visitor) {
return visitor.visitBlock(this);
}
@@ -8165,6 +8205,7 @@ function For(initializer, condition, update, body, forToken) {
// Initializers done
}
$inherits(For, Statement);
+For.prototype.get$body = function() { return this.body; };
For.prototype.accept = function(visitor) {
return visitor.visitFor(this);
}
@@ -8195,6 +8236,7 @@ $inherits(FunctionExpression, Expression);
FunctionExpression.prototype.is$FunctionExpression = function(){return this;};
FunctionExpression.prototype.get$name = function() { return this.name; };
FunctionExpression.prototype.get$parameters = function() { return this.parameters; };
+FunctionExpression.prototype.get$body = function() { return this.body; };
FunctionExpression.prototype.get$returnType = function() { return this.returnType; };
FunctionExpression.prototype.accept = function(visitor) {
return visitor.visitFunctionExpression(this);
@@ -8510,6 +8552,7 @@ function VariableDefinitions(type, modifiers, definitions, endToken) {
}
$inherits(VariableDefinitions, Statement);
VariableDefinitions.prototype.is$VariableDefinitions = function(){return this;};
+VariableDefinitions.prototype.get$type = function() { return this.type; };
VariableDefinitions.prototype.accept = function(visitor) {
return visitor.visitVariableDefinitions(this);
}
@@ -8685,6 +8728,7 @@ function ElementKind(id) {
this.id = id;
// Initializers done
}
+ElementKind.prototype.get$id = function() { return this.id; };
// ********** Code for Element **************
function Element(name, kind, enclosingElement) {
this.name = name;
@@ -8694,6 +8738,7 @@ function Element(name, kind, enclosingElement) {
}
Element.prototype.is$Element = function(){return this;};
Element.prototype.get$name = function() { return this.name; };
+Element.prototype.get$kind = function() { return this.kind; };
Element.prototype.hashCode = function() {
return this.name.hashCode();
}
@@ -8711,6 +8756,8 @@ function VariableElement(node, typeAnnotation, name, enclosingElement) {
// Initializers done
}
$inherits(VariableElement, Element);
+VariableElement.prototype.get$type = function() { return this.type; };
+VariableElement.prototype.set$type = function(value) { return this.type = value; };
VariableElement.prototype.parseNode = function(canceler, logger) {
return this.node;
}
@@ -8738,6 +8785,8 @@ function FunctionElement(name) {
// Initializers done
}
$inherits(FunctionElement, Element);
+FunctionElement.prototype.get$type = function() { return this.type; };
+FunctionElement.prototype.set$type = function(value) { return this.type = value; };
FunctionElement.prototype.computeType = function(compiler, types) {
var $0;
if (this.type != null) return (($0 = this.type) && $0.is$FunctionType());
@@ -8763,6 +8812,8 @@ function ClassElement(name) {
}
$inherits(ClassElement, Element);
ClassElement.prototype.is$ClassElement = function(){return this;};
+ClassElement.prototype.get$type = function() { return this.type; };
+ClassElement.prototype.set$type = function(value) { return this.type = value; };
ClassElement.prototype.get$interfaces = function() { return this.interfaces; };
ClassElement.prototype.set$interfaces = function(value) { return this.interfaces = value; };
ClassElement.prototype.computeType = function(compiler, types) {
@@ -8784,7 +8835,7 @@ ClassElement.prototype.resolve$1 = function($0) {
function getType(annotation, types) {
var $0;
if (annotation == null || annotation.typeName == null) {
- return (($0 = types.dynamicType) && $0.is$Type());
+ return (($0 = types.get$dynamicType()) && $0.is$Type());
}
return (($0 = types.lookup$1(annotation.typeName.get$source())) && $0.is$Type());
}
@@ -9709,6 +9760,8 @@ HBasicBlock.withId$ctor = function(id) {
HBasicBlock.withId$ctor.prototype = HBasicBlock.prototype;
$inherits(HBasicBlock, HInstructionList);
HBasicBlock.prototype.is$HBasicBlock = function(){return this;};
+HBasicBlock.prototype.get$id = function() { return this.id; };
+HBasicBlock.prototype.set$id = function(value) { return this.id = value; };
HBasicBlock.prototype.isNew = function() {
return this.status == 0/*HBasicBlock.STATUS_NEW*/;
}
@@ -9718,6 +9771,9 @@ HBasicBlock.prototype.isOpen = function() {
HBasicBlock.prototype.isClosed = function() {
return this.status == 2/*HBasicBlock.STATUS_CLOSED*/;
}
+HBasicBlock.prototype.get$isClosed = function() {
+ return HBasicBlock.prototype.isClosed.bind(this);
+}
HBasicBlock.prototype.open = function() {
$assert(this.isNew(), "isNew()", "nodes.dart", 256, 12);
this.status = 1/*HBasicBlock.STATUS_OPEN*/;
@@ -9784,7 +9840,7 @@ HBasicBlock.prototype.addDominatedBlock = function(block) {
$assert(this.id != null && block.id != null, "id !== null && block.id !== null", "nodes.dart", 341, 12);
$assert(this.dominatedBlocks.indexOf(block) < 0, "dominatedBlocks.indexOf(block) < 0", "nodes.dart", 342, 12);
var index = this.dominatedBlocks.length;
- while (index > 0 && this.dominatedBlocks.$index(index - 1).id > block.id) {
+ while (index > 0 && this.dominatedBlocks.$index(index - 1).get$id() > block.id) {
index--;
}
if (index == this.dominatedBlocks.length) {
@@ -9860,6 +9916,11 @@ function HInstruction(inputs) {
this.prepareGvn();
}
HInstruction.prototype.is$HInstruction = function(){return this;};
+HInstruction.prototype.get$id = function() { return this.id; };
+HInstruction.prototype.set$id = function(value) { return this.id = value; };
+HInstruction.prototype.get$inputs = function() { return this.inputs; };
+HInstruction.prototype.get$previous = function() { return this.previous; };
+HInstruction.prototype.set$previous = function(value) { return this.previous = value; };
HInstruction.prototype.getFlag = function(position) {
return (this.flags & (1 << position)) != 0;
}
@@ -9903,16 +9964,17 @@ HInstruction.prototype.notifyAddedToBlock = function() {
for (var i = 0;
i < this.inputs.length; i++) {
$assert(this.inputs.$index(i).isInBasicBlock$0(), "inputs[i].isInBasicBlock()", "nodes.dart", 511, 14);
- this.inputs.$index(i).get$usedBy().add(this);
+ this.inputs.$index(i).get$usedBy().add$1(this);
}
$assert(this.isValid(), "isValid()", "nodes.dart", 514, 12);
}
HInstruction.prototype.notifyRemovedFromBlock = function() {
+ var $0;
$assert(this.isInBasicBlock(), "isInBasicBlock()", "nodes.dart", 518, 12);
$assert(this.get$usedBy().isEmpty(), "usedBy.isEmpty()", "nodes.dart", 519, 12);
for (var i = 0;
i < this.inputs.length; i++) {
- var inputUsedBy = this.inputs.$index(i).get$usedBy();
+ var inputUsedBy = (($0 = this.inputs.$index(i).get$usedBy()) && $0.is$List());
for (var j = 0;
j < inputUsedBy.length; j++) {
if (inputUsedBy.$index(j) === this) {
@@ -9999,6 +10061,7 @@ function HInvokeForeign(element, inputs, code) {
// Initializers done
}
$inherits(HInvokeForeign, HInvoke);
+HInvokeForeign.prototype.get$code = function() { return this.code; };
HInvokeForeign.prototype.accept = function(visitor) {
return visitor.visitInvokeForeign(this);
}
@@ -10430,7 +10493,7 @@ SsaInstructionMerger.prototype.visitInstruction = function(node) {
i >= 0; i--) {
if (previousUnused == null) return;
if ((previousUnused instanceof HPhi)) return;
- if (inputs.$index(i).get$usedBy().length != 1) return;
+ if ($notnull_bool($ne(inputs.$index(i).get$usedBy().length, 1))) return;
if (inputs.$index(i) !== previousUnused) return;
inputs.$index(i).setGenerateAtUseSite$0();
previousUnused = previousUnused.previous;
@@ -10752,12 +10815,12 @@ HValidator.countInstruction = function(instructions, instruction) {
HValidator.everyInstruction = function(instructions, f) {
var copy = ListFactory.ListFactory$from$factory(instructions);
for (var i = 0;
- i < copy.length; i++) {
+ i < $assert_num(copy.length); i++) {
var current = copy.$index(i);
if (current == null) continue;
var count = 1;
for (var j = i + 1;
- j < copy.length; j++) {
+ j < $assert_num(copy.length); j++) {
if (copy.$index(j) === current) {
copy.$setindex(j);
count++;
@@ -10770,21 +10833,25 @@ HValidator.everyInstruction = function(instructions, f) {
HValidator.prototype.visitInstruction = function(instruction) {
var $this = this; // closure support
function hasCorrectInputs(instruction) {
+ var $0;
var inBasicBlock = $assert_bool(instruction.isInBasicBlock$0());
- return HValidator.everyInstruction(instruction.inputs, (function (input, count) {
+ return HValidator.everyInstruction((($0 = instruction.get$inputs()) && $0.is$List$HInstruction()), (function (input, count) {
+ var $0;
if ($notnull_bool(inBasicBlock)) {
- return HValidator.countInstruction(input.get$usedBy(), (instruction && instruction.is$HInstruction())) == count;
+ return HValidator.countInstruction((($0 = input.get$usedBy()) && $0.is$List$HInstruction()), (instruction && instruction.is$HInstruction())) == count;
}
else {
- return HValidator.countInstruction(input.get$usedBy(), (instruction && instruction.is$HInstruction())) == 0;
+ return HValidator.countInstruction((($0 = input.get$usedBy()) && $0.is$List$HInstruction()), (instruction && instruction.is$HInstruction())) == 0;
}
})
);
}
function hasCorrectUses(instruction) {
+ var $0;
if (!$notnull_bool(instruction.isInBasicBlock$0())) return true;
- return HValidator.everyInstruction(instruction.get$usedBy(), (function (use, count) {
- return HValidator.countInstruction(use.inputs, (instruction && instruction.is$HInstruction())) == count;
+ return HValidator.everyInstruction((($0 = instruction.get$usedBy()) && $0.is$List$HInstruction()), (function (use, count) {
+ var $0;
+ return HValidator.countInstruction((($0 = use.get$inputs()) && $0.is$List$HInstruction()), (instruction && instruction.is$HInstruction())) == count;
})
);
}
@@ -10815,7 +10882,7 @@ WorldCompiler.prototype.run = function() {
if ($notnull_bool(success)) {
var code = this.getGeneratedCode();
this.world.legCode = $assert_String(code);
- this.world.jsBytesWritten = code.length;
+ this.world.jsBytesWritten = $assert_num(code.length);
var $list = this.tasks;
for (var $i0 = 0;$i0 < $list.length; $i0++) {
var task = $list.$index($i0);
@@ -10854,6 +10921,8 @@ function Compiler(script) {
this.tasks = [this.scanner, this.parser, this.resolver, this.checker, this.builder, this.optimizer, this.generator];
}
Compiler.prototype.is$Compiler = function(){return this;};
+Compiler.prototype.get$generator = function() { return this.generator; };
+Compiler.prototype.set$generator = function(value) { return this.generator = value; };
Compiler.prototype.ensure = function(condition) {
if (!$notnull_bool(condition)) this.cancel('failed assertion in leg');
}
@@ -11302,6 +11371,7 @@ function leg_Script(file) {
this.file = file;
// Initializers done
}
+leg_Script.prototype.get$file = function() { return this.file; };
leg_Script.prototype.get$text = function() {
return this.file.get$text();
}
@@ -11315,6 +11385,8 @@ $inherits(TypeCheckerTask, CompilerTask);
TypeCheckerTask.prototype.get$name = function() {
return "Type checker";
}
+TypeCheckerTask.prototype.get$types = function() { return this.types; };
+TypeCheckerTask.prototype.set$types = function(value) { return this.types = value; };
TypeCheckerTask.prototype.check = function(tree, elements) {
var $this = this; // closure support
this.measure((function () {
@@ -11396,6 +11468,7 @@ function Types() {
// Initializers done
}
Types.prototype.is$Types = function(){return this;};
+Types.prototype.get$dynamicType = function() { return this.dynamicType; };
Types.prototype.lookup = function(s) {
if ($notnull_bool($eq(const$4/*Types.VOID*/, s))) {
return this.voidType;
@@ -11434,6 +11507,8 @@ function TypeCheckerVisitor(compiler, elements, types) {
// Initializers done
}
TypeCheckerVisitor.prototype.is$Visitor = function(){return this;};
+TypeCheckerVisitor.prototype.get$types = function() { return this.types; };
+TypeCheckerVisitor.prototype.set$types = function(value) { return this.types = value; };
TypeCheckerVisitor.prototype.fail = function(node, reason) {
var message = 'cannot type-check';
if (reason != null) {
@@ -11457,6 +11532,9 @@ TypeCheckerVisitor.prototype.type = function(node) {
var result = (($0 = node.accept(this)) && $0.is$Type());
return result;
}
+TypeCheckerVisitor.prototype.get$type = function() {
+ return TypeCheckerVisitor.prototype.type.bind(this);
+}
TypeCheckerVisitor.prototype.checkAssignable = function(node, s, t) {
if (!$notnull_bool(this.types.isAssignable(s, t))) {
var error = CompilerError.notAssignable(s, t);
@@ -11846,7 +11924,7 @@ WorldGenerator.prototype.run = function() {
this.writeTypes(world.corelib);
this.writeTypes(this.main.declaringType.get$library());
this._writeGlobals();
- this.writer.writeln(('RunEntry(function () {' + mainCall.code + ';}, []);'));
+ this.writer.writeln(('RunEntry(function () {' + mainCall.get$code() + ';}, []);'));
}
WorldGenerator.prototype.globalForStaticField = function(field, fieldValue, dependencies) {
var $0;
@@ -11865,16 +11943,17 @@ WorldGenerator.prototype.globalForConst = function(exp, dependencies) {
return (($0 = this.globals.$index(code)) && $0.is$GlobalValue());
}
WorldGenerator.prototype.writeTypes = function(lib) {
+ var $0;
if ($notnull_bool(lib.isWritten)) return;
lib.isWritten = true;
var $list = lib.imports;
for (var $i = 0;$i < $list.length; $i++) {
var import_ = $list.$index($i);
- this.writeTypes(import_.get$library());
+ this.writeTypes((($0 = import_.get$library()) && $0.is$Library()));
}
for (var i = 0;
i < lib.sources.length; i++) {
- lib.sources.$index(i).orderInLibrary = i;
+ lib.sources.$index(i).set$orderInLibrary(i);
}
this.writer.comment(('// ********** Library ' + lib.name + ' **************'));
if ($notnull_bool(lib.get$isCore())) {
@@ -11884,9 +11963,9 @@ WorldGenerator.prototype.writeTypes = function(lib) {
var $list = lib.natives;
for (var $i = 0;$i < $list.length; $i++) {
var file = $list.$index($i);
- var filename = basename(file.filename);
+ var filename = basename($assert_String(file.get$filename()));
this.writer.comment(('// ********** Natives ' + filename + ' **************'));
- this.writer.writeln(file.get$text());
+ this.writer.writeln($assert_String(file.get$text()));
}
lib.topType.markUsed();
var $list = this._orderValues(lib.types);
@@ -11902,12 +11981,12 @@ WorldGenerator.prototype.writeTypes = function(lib) {
}
}
}
- if ($notnull_bool(type.get$isFunction() && type.varStubs != null)) {
+ if ($notnull_bool(type.get$isFunction() && $ne(type.get$varStubs(), null))) {
this.writer.comment(('// ********** Code for ' + type.get$jsname() + ' **************'));
this._writeDynamicStubs((type && type.is$lang_Type()));
}
- if (type.typeCheckCode != null) {
- this.writer.writeln(type.typeCheckCode);
+ if ($notnull_bool($ne(type.get$typeCheckCode(), null))) {
+ this.writer.writeln($assert_String(type.get$typeCheckCode()));
}
}
}
@@ -11961,8 +12040,8 @@ WorldGenerator.prototype.writeType = function(type) {
var $list = type.get$constructors().getValues();
for (var $i = type.get$constructors().getValues().iterator$0(); $i.hasNext$0(); ) {
var c = $i.next$0();
- if ($notnull_bool($ne(c.generator, null) && $ne(c, standardConstructor))) {
- c.generator.writeDefinition$2(this.writer);
+ if ($notnull_bool($ne(c.get$generator(), null) && $ne(c, standardConstructor))) {
+ c.get$generator().writeDefinition$2(this.writer);
}
}
}
@@ -11995,7 +12074,7 @@ WorldGenerator.prototype.writeType = function(type) {
seen.addAll(type.get$interfaces());
while (!worklist.isEmpty()) {
var interface_ = worklist.removeLast();
- this._maybeIsTest(type, interface_.get$genericType());
+ this._maybeIsTest(type, (($0 = interface_.get$genericType()) && $0.is$lang_Type()));
if (interface_.get$genericType()._concreteTypes != null) {
var $list = this._orderValues(interface_.get$genericType()._concreteTypes);
for (var $i = 0;$i < $list.length; $i++) {
@@ -12049,10 +12128,10 @@ WorldGenerator.prototype._writeStaticField = function(field) {
if (this.globals.containsKey(fullname)) {
var value = this.globals.$index(fullname);
if ($notnull_bool(field.declaringType.get$isTop() && !$notnull_bool(field.isNative))) {
- this.writer.writeln(('var ' + field.get$jsname() + ' = ' + value.exp.code + ';'));
+ this.writer.writeln(('var ' + field.get$jsname() + ' = ' + value.get$exp().get$code() + ';'));
}
else {
- this.writer.writeln(('' + field.declaringType.get$jsname() + '.' + field.get$jsname() + ' = ' + value.exp.code + ';'));
+ this.writer.writeln(('' + field.declaringType.get$jsname() + '.' + field.get$jsname() + ' = ' + value.get$exp().get$code() + ';'));
}
}
}
@@ -12091,6 +12170,7 @@ WorldGenerator.prototype.get$_writeMethod = function() {
return WorldGenerator.prototype._writeMethod.bind(this);
}
WorldGenerator.prototype._writeGlobals = function() {
+ var $0;
if (this.globals.get$length() > 0) {
this.writer.comment('// ********** Globals **************');
}
@@ -12101,11 +12181,11 @@ WorldGenerator.prototype._writeGlobals = function() {
);
for (var $i = list.iterator$0(); $i.hasNext$0(); ) {
var global = $i.next$0();
- if (global.field != null) {
- this._writeStaticField(global.field);
+ if ($notnull_bool($ne(global.get$field(), null))) {
+ this._writeStaticField((($0 = global.get$field()) && $0.is$FieldMember()));
}
else {
- this.writer.writeln(('var ' + global.get$name() + ' = ' + global.exp.code + ';'));
+ this.writer.writeln(('var ' + global.get$name() + ' = ' + global.get$exp().get$code() + ';'));
}
}
}
@@ -12116,12 +12196,12 @@ WorldGenerator.prototype._orderValues = function(map) {
return values;
}
WorldGenerator.prototype._compareMembers = function(x, y) {
- if (x.get$span() != null && y.get$span() != null) {
- var spans = x.get$span().compareTo(y.get$span());
+ if ($notnull_bool($ne(x.get$span(), null) && $ne(y.get$span(), null))) {
+ var spans = $assert_num(x.get$span().compareTo$1(y.get$span()));
if (spans != 0) return spans;
}
- if (x.get$span() == null) return 1;
- if (y.get$span() == null) return -1;
+ if ($notnull_bool(x.get$span() == null)) return 1;
+ if ($notnull_bool(y.get$span() == null)) return -1;
return $assert_num(x.get$name().compareTo$1(y.get$name()));
}
WorldGenerator.prototype.get$_compareMembers = function() {
@@ -12152,8 +12232,14 @@ function BlockScope(enclosingMethod, parent, reentrant) {
}
}
BlockScope.prototype.is$BlockScope = function(){return this;};
+BlockScope.prototype.get$enclosingMethod = function() { return this.enclosingMethod; };
+BlockScope.prototype.set$enclosingMethod = function(value) { return this.enclosingMethod = value; };
BlockScope.prototype.get$parent = function() { return this.parent; };
BlockScope.prototype.set$parent = function(value) { return this.parent = value; };
+BlockScope.prototype.get$rethrow = function() { return this.rethrow; };
+BlockScope.prototype.set$rethrow = function(value) { return this.rethrow = value; };
+BlockScope.prototype.get$reentrant = function() { return this.reentrant; };
+BlockScope.prototype.set$reentrant = function(value) { return this.reentrant = value; };
BlockScope.prototype.get$isMethodScope = function() {
return this.parent == null || $ne(this.parent.enclosingMethod, this.enclosingMethod);
}
@@ -12169,10 +12255,10 @@ BlockScope.prototype.lookup = function(name) {
$notnull_bool($ne(s, null)); s = s.get$parent()) {
ret = s._vars.$index(name);
if ($notnull_bool($ne(ret, null))) {
- if ($ne(s.enclosingMethod, this.enclosingMethod)) {
- s.get$methodScope()._closedOver.add(ret.code);
- if ($notnull_bool(this.enclosingMethod.captures != null && s.reentrant)) {
- this.enclosingMethod.captures.add(ret.code);
+ if ($notnull_bool($ne(s.get$enclosingMethod(), this.enclosingMethod))) {
+ s.get$methodScope()._closedOver.add(ret.get$code());
+ if ($notnull_bool(this.enclosingMethod.captures != null && s.get$reentrant())) {
+ this.enclosingMethod.captures.add(ret.get$code());
}
}
return ret;
@@ -12213,11 +12299,12 @@ BlockScope.prototype.declare = function(id) {
return this.create(id.name.name, (type && type.is$lang_Type()), id.span, false);
}
BlockScope.prototype.getRethrow = function() {
+ var $0;
var scope = this;
- while ($notnull_bool(scope.rethrow == null && $ne(scope.get$parent(), null))) {
+ while ($notnull_bool(scope.get$rethrow() == null && $ne(scope.get$parent(), null))) {
scope = scope.get$parent();
}
- return scope.rethrow;
+ return (($0 = scope.get$rethrow()) && $0.is$Value());
}
BlockScope.prototype.lookup$1 = function($0) {
return this.lookup($assert_String($0));
@@ -12246,6 +12333,10 @@ function MethodGenerator(method, enclosingMethod) {
}
MethodGenerator.prototype.is$MethodGenerator = function(){return this;};
MethodGenerator.prototype.is$TreeVisitor = function(){return this;};
+MethodGenerator.prototype.get$enclosingMethod = function() { return this.enclosingMethod; };
+MethodGenerator.prototype.set$enclosingMethod = function(value) { return this.enclosingMethod = value; };
+MethodGenerator.prototype.get$needsThis = function() { return this.needsThis; };
+MethodGenerator.prototype.set$needsThis = function(value) { return this.needsThis = value; };
MethodGenerator.prototype.get$library = function() {
return this.method.get$library();
}
@@ -12292,8 +12383,8 @@ MethodGenerator.prototype.run = function() {
if ($notnull_bool(this.method.isGenerated)) return;
this.method.isGenerated = true;
this.method.generator = this;
- if ((this.method.get$definition().body instanceof NativeStatement)) {
- if ($notnull_bool(this.method.get$definition().body.body == null)) {
+ if ((this.method.get$definition().get$body() instanceof NativeStatement)) {
+ if ($notnull_bool(this.method.get$definition().get$body().get$body() == null)) {
this.method.generator = null;
}
else {
@@ -12301,7 +12392,7 @@ MethodGenerator.prototype.run = function() {
return p.get$name();
})
);
- this.writer.write($assert_String(this.method.get$definition().body.body));
+ this.writer.write($assert_String(this.method.get$definition().get$body().get$body()));
}
}
else {
@@ -12410,7 +12501,7 @@ MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) {
var param = $list.$index($i);
if ($notnull_bool(param.get$isOptional())) {
optNames.add$1(param.get$name());
- optValues.add$1(MethodGenerator._escapeString($assert_String(param.get$value().code)));
+ optValues.add$1(MethodGenerator._escapeString($assert_String(param.get$value().get$code())));
}
}
if (optNames.length > 0) {
@@ -12431,6 +12522,7 @@ MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) {
}
}
MethodGenerator.prototype.writeBody = function() {
+ var $0;
var initializers = null;
var initializedFields = null;
if ($notnull_bool(this.method.get$isConstructor())) {
@@ -12442,7 +12534,7 @@ MethodGenerator.prototype.writeBody = function() {
if ((f instanceof FieldMember) && !$notnull_bool(f.get$isStatic())) {
var cv = f.computeValue$0();
if ($notnull_bool($ne(cv, null))) {
- initializers.add$1(('this.' + f.get$jsname() + ' = ' + cv.code + ''));
+ initializers.add$1(('this.' + f.get$jsname() + ' = ' + cv.get$code() + ''));
initializedFields.add$1(f.get$name());
}
}
@@ -12452,82 +12544,82 @@ MethodGenerator.prototype.writeBody = function() {
var $list = this.method.get$parameters();
for (var $i = 0;$i < $list.length; $i++) {
var p = $list.$index($i);
- if ($notnull_bool($ne(initializers, null) && p.isInitializer)) {
+ if ($notnull_bool($ne(initializers, null) && p.get$isInitializer())) {
var field = this.method.declaringType.getMember(p.get$name());
if ($notnull_bool(field == null)) {
- world.error('bad this parameter - no matching field', p.get$definition().get$span());
+ world.error('bad this parameter - no matching field', (($0 = p.get$definition().get$span()) && $0.is$SourceSpan()));
}
if (!$notnull_bool(field.get$isField())) {
- world.error(('"this.' + p.get$name() + '" does not refer to a field'), p.get$definition().get$span());
+ world.error(('"this.' + p.get$name() + '" does not refer to a field'), (($0 = p.get$definition().get$span()) && $0.is$SourceSpan()));
}
var paramValue = new Value(field.get$returnType(), p.get$name(), p.get$definition().get$span(), false);
- this._paramCode.add(paramValue.code);
- initializers.add$1(('this.' + field.get$jsname() + ' = ' + paramValue.code + ';'));
+ this._paramCode.add(paramValue.get$code());
+ initializers.add$1(('this.' + field.get$jsname() + ' = ' + paramValue.get$code() + ';'));
initializedFields.add$1(p.get$name());
}
else {
var paramValue = this._scope.declareParameter((p && p.is$Parameter()));
- this._paramCode.add(paramValue.code);
+ this._paramCode.add(paramValue.get$code());
}
}
- var body = this.method.get$definition().body;
+ var body = this.method.get$definition().get$body();
if ($notnull_bool(body == null && !$notnull_bool(this.method.get$isConstructor()))) {
- world.error(('unexpected empty body for ' + this.method.name + ''), this.method.get$definition().get$span());
+ world.error(('unexpected empty body for ' + this.method.name + ''), (($0 = this.method.get$definition().get$span()) && $0.is$SourceSpan()));
}
if ($notnull_bool($ne(initializers, null))) {
for (var $i = initializers.iterator$0(); $i.hasNext$0(); ) {
var i = $i.next$0();
this.writer.writeln($assert_String(i));
}
- var declaredInitializers = this.method.get$definition().initializers;
- if (declaredInitializers != null) {
+ var declaredInitializers = this.method.get$definition().get$initializers();
+ if ($notnull_bool($ne(declaredInitializers, null))) {
var initializerCall = null;
- for (var $i = 0;$i < declaredInitializers.length; $i++) {
- var init = declaredInitializers.$index($i);
+ for (var $i = declaredInitializers.iterator$0(); $i.hasNext$0(); ) {
+ var init = $i.next$0();
if ((init instanceof CallExpression)) {
if ($notnull_bool($ne(initializerCall, null))) {
- world.error('only one initializer redirecting call is allowed', init.get$span());
+ world.error('only one initializer redirecting call is allowed', (($0 = init.get$span()) && $0.is$SourceSpan()));
}
initializerCall = init;
}
- else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign(init.op.kind) == 0) {
- var left = init.x;
- if (!((left instanceof DotExpression) && (left.self instanceof ThisExpression) || (left instanceof VarExpression))) {
- world.error('invalid left side of initializer', left.get$span());
+ else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign($assert_num(init.get$op().get$kind())) == 0) {
+ var left = init.get$x();
+ if (!((left instanceof DotExpression) && (left.get$self() instanceof ThisExpression) || (left instanceof VarExpression))) {
+ world.error('invalid left side of initializer', (($0 = left.get$span()) && $0.is$SourceSpan()));
continue;
}
var f = this.method.declaringType.getMember(left.get$name().get$name());
if ($notnull_bool(f == null)) {
- world.error('bad initializer - no matching field', left.get$span());
+ world.error('bad initializer - no matching field', (($0 = left.get$span()) && $0.is$SourceSpan()));
continue;
}
else if (!$notnull_bool(f.get$isField())) {
- world.error(('"' + left.get$name().get$name() + '" does not refer to a field'), left.get$span());
+ world.error(('"' + left.get$name().get$name() + '" does not refer to a field'), (($0 = left.get$span()) && $0.is$SourceSpan()));
continue;
}
initializedFields.add$1(f.get$name());
- this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValue(init.y).code + ';'));
+ this.writer.writeln(('this.' + f.get$jsname() + ' = ' + this.visitValue((($0 = init.get$y()) && $0.is$lang_Expression())).get$code() + ';'));
}
else {
- world.error('invalid initializer', init.get$span());
+ world.error('invalid initializer', (($0 = init.get$span()) && $0.is$SourceSpan()));
}
}
if ($notnull_bool($ne(initializerCall, null))) {
var target = this._writeInitializerCall((initializerCall && initializerCall.is$CallExpression()));
- if (!$notnull_bool(target.isSuper)) {
+ if (!$notnull_bool(target.get$isSuper())) {
if (initializers.length > 0) {
var $list = this.method.get$parameters();
for (var $i = 0;$i < $list.length; $i++) {
var p = $list.$index($i);
- if ($notnull_bool(p.isInitializer)) {
- world.error('no initialization allowed on redirecting constructors', p.get$definition().get$span());
+ if ($notnull_bool(p.get$isInitializer())) {
+ world.error('no initialization allowed on redirecting constructors', (($0 = p.get$definition().get$span()) && $0.is$SourceSpan()));
break;
}
}
}
if (declaredInitializers.length > 1) {
- var init = $notnull_bool($eq(declaredInitializers.$index(0), initializerCall)) ? declaredInitializers.$index(1) : declaredInitializers.$index(0);
- world.error('no initialization allowed on redirecting constructors', init.get$span());
+ var init0 = $notnull_bool($eq(declaredInitializers.$index(0), initializerCall)) ? declaredInitializers.$index(1) : declaredInitializers.$index(0);
+ world.error('no initialization allowed on redirecting constructors', (($0 = init0.get$span()) && $0.is$SourceSpan()));
}
initializedFields = null;
}
@@ -12542,8 +12634,8 @@ MethodGenerator.prototype.writeBody = function() {
for (var $i = this.method.declaringType.get$members().getKeys().iterator$0(); $i.hasNext$0(); ) {
var name = $i.next$0();
var member = this.method.declaringType.get$members().$index(name);
- if ($notnull_bool((member instanceof FieldMember) && member.isFinal) && !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.contains$1(name))) {
- world.error(('Field "' + name + '" is final and was not initialized'), this.method.get$definition().get$span());
+ if ($notnull_bool((member instanceof FieldMember) && member.get$isFinal()) && !$notnull_bool(member.get$isStatic()) && !$notnull_bool(initializedFields.contains$1(name))) {
+ world.error(('Field "' + name + '" is final and was not initialized'), (($0 = this.method.get$definition().get$span()) && $0.is$SourceSpan()));
}
}
}
@@ -12567,7 +12659,7 @@ MethodGenerator.prototype._writeInitializerCall = function(node) {
else {
world.error('bad call in initializers', node.span);
}
- var m = target.type.getConstructor$1(contructorName);
+ var m = target.get$type().getConstructor$1(contructorName);
this.method.set$initDelegate(m);
var other = m;
while ($notnull_bool($ne(other, null))) {
@@ -12579,8 +12671,8 @@ MethodGenerator.prototype._writeInitializerCall = function(node) {
}
world.gen.genMethod((m && m.is$Member()));
var value = m.invoke$4(this, node, target, this._makeArgs(node.arguments));
- if ($notnull_bool($ne(target.type, world.objectType))) {
- this.writer.writeln(('' + value.code + ';'));
+ if ($notnull_bool($ne(target.get$type(), world.objectType))) {
+ this.writer.writeln(('' + value.get$code() + ';'));
}
return (target && target.is$Value());
}
@@ -12590,11 +12682,11 @@ MethodGenerator.prototype._makeArgs = function(arguments) {
var seenLabel = false;
for (var $i = 0;$i < arguments.length; $i++) {
var arg = arguments.$index($i);
- if (arg.label != null) {
+ if ($notnull_bool($ne(arg.get$label(), null))) {
seenLabel = true;
}
else if ($notnull_bool(seenLabel)) {
- world.error('bare argument can not follow named arguments', arg.get$span());
+ world.error('bare argument can not follow named arguments', (($0 = arg.get$span()) && $0.is$SourceSpan()));
}
args.add$1(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression())));
}
@@ -12625,7 +12717,7 @@ MethodGenerator.prototype._popBlock = function() {
}
MethodGenerator.prototype._makeLambdaMethod = function(name, func) {
var meth = new MethodMember(name, this.method.declaringType, func);
- meth.isLambda = true;
+ meth.set$isLambda(true);
meth.resolve$1(this.method.declaringType);
world.gen.genMethod((meth && meth.is$Member()), this);
return (meth && meth.is$MethodMember());
@@ -12651,14 +12743,15 @@ MethodGenerator.prototype.visitVoid = function(node) {
return this.visitValue(node);
}
MethodGenerator.prototype.visitDietStatement = function(node) {
+ var $0;
var parser = new lang_Parser(node.span.file, false, false, false, node.span.start);
- this.visitStatementsInBlock(parser.block$0());
+ this.visitStatementsInBlock((($0 = parser.block$0()) && $0.is$lang_Statement()));
return false;
}
MethodGenerator.prototype.visitVariableDefinition = function(node) {
var $0;
var isFinal = false;
- if ($notnull_bool(node.modifiers != null && $eq(node.modifiers.$index(0).kind, 97/*TokenKind.FINAL*/))) {
+ if ($notnull_bool(node.modifiers != null && $eq(node.modifiers.$index(0).get$kind(), 97/*TokenKind.FINAL*/))) {
isFinal = true;
}
this.writer.write('var ');
@@ -12676,16 +12769,16 @@ MethodGenerator.prototype.visitVariableDefinition = function(node) {
world.error('no value specified for final variable', node.span);
}
else {
- if ($notnull_bool(thisType.get$isVar())) thisType = value.type;
+ if ($notnull_bool(thisType.get$isVar())) thisType = value.get$type();
}
}
- var val = this._scope.create($assert_String(name), (thisType && thisType.is$lang_Type()), node.names.$index(i).get$span(), false);
+ var val = this._scope.create($assert_String(name), (thisType && thisType.is$lang_Type()), (($0 = node.names.$index(i).get$span()) && $0.is$SourceSpan()), false);
if ($notnull_bool(value == null)) {
- this.writer.write(('' + val.code + ''));
+ this.writer.write(('' + val.get$code() + ''));
}
else {
value = value.convertTo$3(this, type, node.values.$index(i));
- this.writer.write(('' + val.code + ' = ' + value.code + ''));
+ this.writer.write(('' + val.get$code() + ' = ' + value.get$code() + ''));
}
}
this.writer.writeln(';');
@@ -12695,8 +12788,8 @@ MethodGenerator.prototype.visitFunctionDefinition = function(node) {
var $0;
var name = world.toJsIdentifier(node.name.name);
var meth = this._makeLambdaMethod($assert_String(name), node);
- var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$functionType()) && $0.is$lang_Type()), this.method.get$definition().get$span(), false);
- meth.generator.writeDefinition$2(this.writer);
+ var funcValue = this._scope.create($assert_String(name), (($0 = meth.get$functionType()) && $0.is$lang_Type()), (($0 = this.method.get$definition().get$span()) && $0.is$SourceSpan()), false);
+ meth.get$generator().writeDefinition$2(this.writer);
return false;
}
MethodGenerator.prototype.visitReturnStatement = function(node) {
@@ -12708,7 +12801,7 @@ MethodGenerator.prototype.visitReturnStatement = function(node) {
world.error('return of value not allowed from constructor', node.span);
}
var value = this.visitTypedValue(node.value, this.method.get$returnType());
- this.writer.writeln(('return ' + value.code + ';'));
+ this.writer.writeln(('return ' + value.get$code() + ';'));
}
return true;
}
@@ -12716,7 +12809,7 @@ MethodGenerator.prototype.visitThrowStatement = function(node) {
if (node.value != null) {
var value = this.visitValue(node.value);
value.invoke$4(this, 'toString', node, Arguments.get$EMPTY());
- this.writer.writeln(('\$throw(' + value.code + ');'));
+ this.writer.writeln(('\$throw(' + value.get$code() + ');'));
world.gen.corejs.useThrow = true;
}
else {
@@ -12725,7 +12818,7 @@ MethodGenerator.prototype.visitThrowStatement = function(node) {
world.error('rethrow outside of catch', node.span);
}
else {
- this.writer.writeln(('throw ' + rethrow.code + ';'));
+ this.writer.writeln(('throw ' + rethrow.get$code() + ';'));
}
}
return true;
@@ -12738,9 +12831,9 @@ MethodGenerator.prototype.visitAssertStatement = function(node) {
world.gen.genMethod((($0 = err.getConstructor$1('')) && $0.is$Member()));
world.gen.genMethod((($0 = err.get$members().$index('toString')) && $0.is$Member()));
var span = node.test.span;
- var line = span.file.getLine(span.start);
- var column = span.file.getColumn($assert_num(line), span.start);
- this.writer.writeln(('\$assert(' + test.code + ', "' + MethodGenerator._escapeString(span.get$text()) + '",') + (' "' + basename(span.file.filename) + '", ' + (line + 1) + ', ' + (column + 1) + ');'));
+ var line = span.get$file().getLine$1(span.get$start());
+ var column = span.get$file().getColumn$2(line, span.get$start());
+ this.writer.writeln(('\$assert(' + test.get$code() + ', "' + MethodGenerator._escapeString($assert_String(span.get$text())) + '",') + (' "' + basename($assert_String(span.get$file().get$filename())) + '", ' + (line + 1) + ', ' + (column + 1) + ');'));
world.gen.corejs.useAssert = true;
}
return false;
@@ -12765,7 +12858,7 @@ MethodGenerator.prototype.visitContinueStatement = function(node) {
}
MethodGenerator.prototype.visitIfStatement = function(node) {
var test = this.visitBool(node.test);
- this.writer.write(('if (' + test.code + ') '));
+ this.writer.write(('if (' + test.get$code() + ') '));
var exit1 = node.trueBranch.visit(this);
if (node.falseBranch != null) {
this.writer.write('else ');
@@ -12777,7 +12870,7 @@ MethodGenerator.prototype.visitIfStatement = function(node) {
}
MethodGenerator.prototype.visitWhileStatement = function(node) {
var test = this.visitBool(node.test);
- this.writer.write(('while (' + test.code + ') '));
+ this.writer.write(('while (' + test.get$code() + ') '));
this._pushBlock(true);
node.body.visit(this);
this._popBlock();
@@ -12789,7 +12882,7 @@ MethodGenerator.prototype.visitDoStatement = function(node) {
node.body.visit(this);
this._popBlock();
var test = this.visitBool(node.test);
- this.writer.writeln(('while (' + test.code + ')'));
+ this.writer.writeln(('while (' + test.get$code() + ')'));
return false;
}
MethodGenerator.prototype.visitForStatement = function(node) {
@@ -12799,7 +12892,7 @@ MethodGenerator.prototype.visitForStatement = function(node) {
else this.writer.write(';');
if (node.test != null) {
var test = this.visitBool(node.test);
- this.writer.write((' ' + test.code + '; '));
+ this.writer.write((' ' + test.get$code() + '; '));
}
else {
this.writer.write('; ');
@@ -12810,7 +12903,7 @@ MethodGenerator.prototype.visitForStatement = function(node) {
var s = $list.$index($i);
if ($notnull_bool(needsComma)) this.writer.write(', ');
var sv = this.visitVoid((s && s.is$lang_Expression()));
- this.writer.write($assert_String(sv.code));
+ this.writer.write($assert_String(sv.get$code()));
needsComma = true;
}
this.writer.write(') ');
@@ -12828,24 +12921,24 @@ MethodGenerator.prototype.visitForInStatement = function(node) {
this._pushBlock(true);
var item = this._scope.create($assert_String(itemName), (itemType && itemType.is$lang_Type()), node.item.name.span, false);
var listVar = (list && list.is$Value());
- if ($notnull_bool(list.needsTemp)) {
- listVar = this._scope.create('\$list', (($0 = list.type) && $0.is$lang_Type()), null, false);
- this.writer.writeln(('var ' + listVar.code + ' = ' + list.code + ';'));
+ if ($notnull_bool(list.get$needsTemp())) {
+ listVar = this._scope.create('\$list', (($0 = list.get$type()) && $0.is$lang_Type()), null, false);
+ this.writer.writeln(('var ' + listVar.code + ' = ' + list.get$code() + ';'));
}
- if ($notnull_bool(list.type.get$isList())) {
+ if ($notnull_bool(list.get$type().get$isList())) {
var tmpi = this._scope.create('\$i', world.numType, null, false);
- this.writer.enterBlock(('for (var ' + tmpi.code + ' = 0;') + ('' + tmpi.code + ' < ' + listVar.code + '.length; ' + tmpi.code + '++) {'));
+ this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = 0;') + ('' + tmpi.get$code() + ' < ' + listVar.code + '.length; ' + tmpi.get$code() + '++) {'));
var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [tmpi]), false);
- this.writer.writeln(('var ' + item.code + ' = ' + value.code + ';'));
+ this.writer.writeln(('var ' + item.get$code() + ' = ' + value.get$code() + ';'));
}
else {
this._pushBlock(false);
var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPTY());
- var tmpi = this._scope.create('\$i', (($0 = iterator.type) && $0.is$lang_Type()), null, false);
+ var tmpi = this._scope.create('\$i', (($0 = iterator.get$type()) && $0.is$lang_Type()), null, false);
var hasNext = tmpi.invoke$4(this, 'hasNext', node.list, Arguments.get$EMPTY());
var next = tmpi.invoke$4(this, 'next', node.list, Arguments.get$EMPTY());
- this.writer.enterBlock(('for (var ' + tmpi.code + ' = ' + iterator.code + '; ' + hasNext.code + '; ) {'));
- this.writer.writeln(('var ' + item.code + ' = ' + next.code + ';'));
+ this.writer.enterBlock(('for (var ' + tmpi.get$code() + ' = ' + iterator.get$code() + '; ' + hasNext.get$code() + '; ) {'));
+ this.writer.writeln(('var ' + item.get$code() + ' = ' + next.get$code() + ';'));
}
this.visitStatementsInBlock(node.body);
this.writer.exitBlock('}');
@@ -12876,61 +12969,61 @@ MethodGenerator.prototype.visitTryStatement = function(node) {
this._pushBlock(false);
var ex = this._scope.declare((($0 = catch_.get$exception()) && $0.is$DeclaredIdentifier()));
this._scope.rethrow = (ex && ex.is$Value());
- this.writer.nextBlock(('} catch (' + ex.code + ') {'));
- if (catch_.trace != null) {
- var trace = this._scope.declare(catch_.trace);
- this.writer.writeln(('var ' + trace.code + ' = \$stackTraceOf(' + ex.code + ');'));
+ this.writer.nextBlock(('} catch (' + ex.get$code() + ') {'));
+ if ($notnull_bool($ne(catch_.get$trace(), null))) {
+ var trace = this._scope.declare((($0 = catch_.get$trace()) && $0.is$DeclaredIdentifier()));
+ this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex.get$code() + ');'));
world.gen.corejs.useStackTraceOf = true;
}
- this._genToDartException($assert_String(ex.code), node);
- if (!$notnull_bool(ex.type.get$isVar())) {
- var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.type, catch_.get$exception().get$span(), false, true);
- this.writer.writeln(('if (' + test.code + ') throw ' + ex.code + ';'));
+ this._genToDartException($assert_String(ex.get$code()), node);
+ if (!$notnull_bool(ex.get$type().get$isVar())) {
+ var test = ex.instanceOf$3$isTrue$forceCheck(this, ex.get$type(), catch_.get$exception().get$span(), false, true);
+ this.writer.writeln(('if (' + test.get$code() + ') throw ' + ex.get$code() + ';'));
}
- this.visitStatementsInBlock((($0 = node.catches.$index(0).body) && $0.is$lang_Statement()));
+ this.visitStatementsInBlock((($0 = node.catches.$index(0).get$body()) && $0.is$lang_Statement()));
this._popBlock();
}
else if (node.catches.length > 0) {
this._pushBlock(false);
var ex = this._scope.create('\$ex', world.varType, null, false);
this._scope.rethrow = (ex && ex.is$Value());
- this.writer.nextBlock(('} catch (' + ex.code + ') {'));
+ this.writer.nextBlock(('} catch (' + ex.get$code() + ') {'));
var trace = null;
if (node.catches.some((function (c) {
- return c.trace != null;
+ return $ne(c.get$trace(), null);
})
)) {
trace = this._scope.create('\$trace', world.varType, null, false);
- this.writer.writeln(('var ' + trace.code + ' = \$stackTraceOf(' + ex.code + ');'));
+ this.writer.writeln(('var ' + trace.get$code() + ' = \$stackTraceOf(' + ex.get$code() + ');'));
world.gen.corejs.useStackTraceOf = true;
}
- this._genToDartException($assert_String(ex.code), node);
+ this._genToDartException($assert_String(ex.get$code()), node);
var needsRethrow = true;
for (var i = 0;
i < node.catches.length; i++) {
var catch_ = node.catches.$index(i);
this._pushBlock(false);
var tmp = this._scope.declare((($0 = catch_.get$exception()) && $0.is$DeclaredIdentifier()));
- if (!$notnull_bool(tmp.type.get$isVar())) {
- var test = ex.instanceOf$3$isTrue$forceCheck(this, tmp.type, catch_.get$exception().get$span(), true, true);
+ if (!$notnull_bool(tmp.get$type().get$isVar())) {
+ var test = ex.instanceOf$3$isTrue$forceCheck(this, tmp.get$type(), catch_.get$exception().get$span(), true, true);
if (i == 0) {
- this.writer.enterBlock(('if (' + test.code + ') {'));
+ this.writer.enterBlock(('if (' + test.get$code() + ') {'));
}
else {
- this.writer.nextBlock(('} else if (' + test.code + ') {'));
+ this.writer.nextBlock(('} else if (' + test.get$code() + ') {'));
}
}
else if (i > 0) {
this.writer.nextBlock('} else {');
}
- this.writer.writeln(('var ' + tmp.code + ' = ' + ex.code + ';'));
- if (catch_.trace != null) {
- var tmptrace = this._scope.declare(catch_.trace);
- this.writer.writeln(('var ' + tmptrace.code + ' = ' + trace.code + ';'));
+ this.writer.writeln(('var ' + tmp.get$code() + ' = ' + ex.get$code() + ';'));
+ if ($notnull_bool($ne(catch_.get$trace(), null))) {
+ var tmptrace = this._scope.declare((($0 = catch_.get$trace()) && $0.is$DeclaredIdentifier()));
+ this.writer.writeln(('var ' + tmptrace.get$code() + ' = ' + trace.get$code() + ';'));
}
- this.visitStatementsInBlock((($0 = catch_.body) && $0.is$lang_Statement()));
+ this.visitStatementsInBlock((($0 = catch_.get$body()) && $0.is$lang_Statement()));
this._popBlock();
- if ($notnull_bool(tmp.type.get$isVar())) {
+ if ($notnull_bool(tmp.get$type().get$isVar())) {
if (i + 1 < node.catches.length) {
world.warning('Unreachable catch clause', (($0 = node.catches.$index(i + 1)) && $0.is$SourceSpan()));
}
@@ -12943,7 +13036,7 @@ MethodGenerator.prototype.visitTryStatement = function(node) {
}
if ($notnull_bool(needsRethrow)) {
this.writer.nextBlock('} else {');
- this.writer.writeln(('throw ' + ex.code + ';'));
+ this.writer.writeln(('throw ' + ex.get$code() + ';'));
this.writer.exitBlock('}');
}
this._popBlock();
@@ -12958,33 +13051,34 @@ MethodGenerator.prototype.visitTryStatement = function(node) {
return false;
}
MethodGenerator.prototype.visitSwitchStatement = function(node) {
+ var $0;
var test = this.visitValue(node.test);
- this.writer.enterBlock(('switch (' + test.code + ') {'));
+ this.writer.enterBlock(('switch (' + test.get$code() + ') {'));
var $list = node.cases;
for (var $i = 0;$i < $list.length; $i++) {
var case_ = $list.$index($i);
- if (case_.label != null) {
- world.error('unimplemented: labeled case statement', case_.get$span());
+ if ($notnull_bool($ne(case_.get$label(), null))) {
+ world.error('unimplemented: labeled case statement', (($0 = case_.get$span()) && $0.is$SourceSpan()));
}
this._pushBlock(false);
for (var i = 0;
- i < case_.cases.length; i++) {
- var expr = case_.cases.$index(i);
+ i < $assert_num(case_.get$cases().length); i++) {
+ var expr = case_.get$cases().$index(i);
if ($notnull_bool(expr == null)) {
- if (i < case_.cases.length - 1) {
- world.error('default clause must be the last case', case_.get$span());
+ if (i < case_.get$cases().length - 1) {
+ world.error('default clause must be the last case', (($0 = case_.get$span()) && $0.is$SourceSpan()));
}
this.writer.writeln('default:');
}
else {
var value = this.visitValue((expr && expr.is$lang_Expression()));
- this.writer.writeln(('case ' + value.code + ':'));
+ this.writer.writeln(('case ' + value.get$code() + ':'));
}
}
this.writer.enterBlock('');
- var caseExits = this._visitAllStatements(case_.statements, false);
+ var caseExits = this._visitAllStatements(case_.get$statements(), false);
if ($notnull_bool($ne(case_, node.cases.$index(node.cases.length - 1)) && !$notnull_bool(caseExits))) {
- var span = case_.statements.$index(case_.statements.length - 1).get$span();
+ var span = case_.get$statements().$index(case_.get$statements().length - 1).get$span();
this.writer.writeln('\$throw(new FallThroughError());');
world.gen.corejs.useThrow = true;
}
@@ -12995,12 +13089,13 @@ MethodGenerator.prototype.visitSwitchStatement = function(node) {
return false;
}
MethodGenerator.prototype._visitAllStatements = function(statementList, exits) {
+ var $0;
for (var i = 0;
- i < statementList.length; i++) {
+ i < $assert_num(statementList.length); i++) {
var stmt = statementList.$index(i);
exits = stmt.visit$1(this);
if ($notnull_bool($ne(stmt, statementList.$index(statementList.length - 1)) && exits)) {
- world.warning('unreachable code', statementList.$index(i + 1).get$span());
+ world.warning('unreachable code', (($0 = statementList.$index(i + 1).get$span()) && $0.is$SourceSpan()));
}
}
return $assert_bool(exits);
@@ -13023,7 +13118,7 @@ MethodGenerator.prototype.visitExpressionStatement = function(node) {
world.warning('variable used as statement', node.span);
}
var value = this.visitVoid(node.body);
- this.writer.writeln(('' + value.code + ';'));
+ this.writer.writeln(('' + value.get$code() + ';'));
return false;
}
MethodGenerator.prototype.visitEmptyStatement = function(node) {
@@ -13042,19 +13137,19 @@ MethodGenerator.prototype._makeSuperValue = function(node) {
world.error('no super class', node.span);
}
var ret = new Value(parentType, 'this', node.span, false);
- ret.isSuper = true;
+ ret.set$isSuper(true);
return ret;
}
MethodGenerator.prototype._getOutermostMethod = function() {
var result = this;
- while (result.enclosingMethod != null) {
- result = result.enclosingMethod;
+ while ($notnull_bool($ne(result.get$enclosingMethod(), null))) {
+ result = result.get$enclosingMethod();
}
return result;
}
MethodGenerator.prototype._makeThisCode = function() {
if (this.enclosingMethod != null) {
- this._getOutermostMethod().needsThis = true;
+ this._getOutermostMethod().set$needsThis(true);
return '\$this';
}
else {
@@ -13065,8 +13160,8 @@ MethodGenerator.prototype._makeThisValue = function(node) {
if (this.enclosingMethod != null) {
var outermostMethod = this._getOutermostMethod();
outermostMethod._checkNonStatic(node);
- outermostMethod.needsThis = true;
- return new Value(outermostMethod.method.declaringType, '\$this', node != null ? node.span : null, false);
+ outermostMethod.set$needsThis(true);
+ return new Value(outermostMethod.method.get$declaringType(), '\$this', node != null ? node.span : null, false);
}
else {
this._checkNonStatic(node);
@@ -13080,7 +13175,7 @@ MethodGenerator.prototype.visitLambdaExpression = function(node) {
}
var meth = this._makeLambdaMethod($assert_String(name), node.func);
var w = new CodeWriter();
- meth.generator.writeDefinition$2(w, node);
+ meth.get$generator().writeDefinition$2(w, node);
return new Value(meth.get$functionType(), w.get$text(), node.span, true);
}
MethodGenerator.prototype.visitCallExpression = function(node) {
@@ -13120,12 +13215,12 @@ MethodGenerator.prototype.visitBinaryExpression = function(node) {
if (kind == 35/*TokenKind.AND*/ || kind == 34/*TokenKind.OR*/) {
var x = this.visitValue(node.x);
var y = this.visitValue(node.y);
- var code = ('' + x.code + ' ' + node.op + ' ' + y.code + '');
+ var code = ('' + x.get$code() + ' ' + node.op + ' ' + y.get$code() + '');
if ($notnull_bool(x.get$isConst() && y.get$isConst())) {
var value = (kind == 35/*TokenKind.AND*/) ? $notnull_bool(x.get$actualValue() && y.get$actualValue()) : $notnull_bool(x.get$actualValue() || y.get$actualValue());
- return EvaluatedValue.EvaluatedValue$factory((($0 = x.type) && $0.is$lang_Type()), value, ('' + value + ''), node.span);
+ return EvaluatedValue.EvaluatedValue$factory((($0 = x.get$type()) && $0.is$lang_Type()), value, ('' + value + ''), node.span);
}
- var ret = new Value(lang_Type.union((($0 = x.type) && $0.is$lang_Type()), (($0 = y.type) && $0.is$lang_Type())), code, node.span, true);
+ var ret = new Value(lang_Type.union((($0 = x.get$type()) && $0.is$lang_Type()), (($0 = y.get$type()) && $0.is$lang_Type())), code, node.span, true);
return ret.convertTo$3(this, world.nonNullBool, node);
}
else if (kind == 50/*TokenKind.EQ_STRICT*/ || kind == 51/*TokenKind.NE_STRICT*/) {
@@ -13135,12 +13230,12 @@ MethodGenerator.prototype.visitBinaryExpression = function(node) {
var value = kind == 50/*TokenKind.EQ_STRICT*/ ? $eq(x.get$actualValue(), y.get$actualValue()) : $ne(x.get$actualValue(), y.get$actualValue());
return EvaluatedValue.EvaluatedValue$factory(world.nonNullBool, value, ("" + value + ""), node.span);
}
- if ($notnull_bool($eq(x.code, 'null') || $eq(y.code, 'null'))) {
+ if ($notnull_bool($eq(x.get$code(), 'null') || $eq(y.get$code(), 'null'))) {
var op = node.op.toString().substring(0, 2);
- return new Value(world.nonNullBool, ('' + x.code + ' ' + op + ' ' + y.code + ''), node.span, true);
+ return new Value(world.nonNullBool, ('' + x.get$code() + ' ' + op + ' ' + y.get$code() + ''), node.span, true);
}
else {
- return new Value(world.nonNullBool, ('' + x.code + ' ' + node.op + ' ' + y.code + ''), node.span, true);
+ return new Value(world.nonNullBool, ('' + x.get$code() + ' ' + node.op + ' ' + y.get$code() + ''), node.span, true);
}
}
var assignKind = TokenKind.kindFromAssign(node.op.kind);
@@ -13222,21 +13317,21 @@ MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, cap
}
}
}
- y = y.convertTo$3(this, x.type, yn);
+ y = y.convertTo$3(this, x.get$type(), yn);
if (kind == 0) {
x = captureOriginal((x && x.is$Value()));
- return new Value(y.type, ('' + x.code + ' = ' + y.code + ''), position.span, true);
+ return new Value(y.get$type(), ('' + x.get$code() + ' = ' + y.get$code() + ''), position.span, true);
}
- else if ($notnull_bool(x.type.get$isNum() && y.type.get$isNum()) && (kind != 46/*TokenKind.TRUNCDIV*/)) {
+ else if ($notnull_bool(x.get$type().get$isNum() && y.get$type().get$isNum()) && (kind != 46/*TokenKind.TRUNCDIV*/)) {
x = captureOriginal((x && x.is$Value()));
var op = TokenKind.kindToString(kind);
- return new Value(y.type, ('' + x.code + ' ' + op + '= ' + y.code + ''), position.span, true);
+ return new Value(y.get$type(), ('' + x.get$code() + ' ' + op + '= ' + y.get$code() + ''), position.span, true);
}
else {
var right = x;
right = captureOriginal((right && right.is$Value()));
y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arguments(null, [y]));
- return new Value(y.type, ('' + x.code + ' = ' + y.code + ''), position.span, true);
+ return new Value(y.get$type(), ('' + x.get$code() + ' = ' + y.get$code() + ''), position.span, true);
}
}
MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, captureOriginal) {
@@ -13279,8 +13374,8 @@ MethodGenerator.prototype.visitUnaryExpression = function(node) {
case 16/*TokenKind.INCR*/:
case 17/*TokenKind.DECR*/:
- if ($notnull_bool(value.type.get$isNum())) {
- return new Value(value.type, ('' + node.op + '' + value.code + ''), node.span, true);
+ if ($notnull_bool(value.get$type().get$isNum())) {
+ return new Value(value.get$type(), ('' + node.op + '' + value.get$code() + ''), node.span, true);
}
else {
var kind = (16/*TokenKind.INCR*/ == node.op.kind ? 42/*TokenKind.ADD*/ : 43/*TokenKind.SUB*/);
@@ -13290,13 +13385,13 @@ MethodGenerator.prototype.visitUnaryExpression = function(node) {
case 19/*TokenKind.NOT*/:
- if ($notnull_bool(value.type.get$isBool() && value.get$isConst())) {
+ if ($notnull_bool(value.get$type().get$isBool() && value.get$isConst())) {
var newVal = !$notnull_bool(value.get$actualValue());
- return EvaluatedValue.EvaluatedValue$factory((($0 = value.type) && $0.is$lang_Type()), newVal, ('' + newVal + ''), node.span);
+ return EvaluatedValue.EvaluatedValue$factory((($0 = value.get$type()) && $0.is$lang_Type()), newVal, ('' + newVal + ''), node.span);
}
else {
var newVal = value.convertTo$3(this, world.nonNullBool, node);
- return new Value(newVal.type, ('!' + newVal.code + ''), node.span, true);
+ return new Value(newVal.get$type(), ('!' + newVal.get$code() + ''), node.span, true);
}
case 42/*TokenKind.ADD*/:
@@ -13326,8 +13421,8 @@ MethodGenerator.prototype.visitUnaryExpression = function(node) {
MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) {
var $this = this; // closure support
var value = this.visitValue(node.body);
- if ($notnull_bool(value.type.get$isNum())) {
- return new Value(value.type, ('' + value.code + '' + node.op + ''), node.span, true);
+ if ($notnull_bool(value.get$type().get$isNum())) {
+ return new Value(value.get$type(), ('' + value.get$code() + '' + node.op + ''), node.span, true);
}
var kind = (16/*TokenKind.INCR*/ == node.op.kind) ? 42/*TokenKind.ADD*/ : 43/*TokenKind.SUB*/;
var operand = new LiteralExpression(1, new TypeReference(node.span, world.numType), '1', node.span);
@@ -13344,7 +13439,7 @@ MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) {
})
);
if ($notnull_bool($ne(tmpleft, null))) {
- ret = new Value(ret.type, ("(" + ret.code + ", " + tmpleft.code + ")"), node.span, true);
+ ret = new Value(ret.get$type(), ("(" + ret.get$code() + ", " + tmpleft.get$code() + ")"), node.span, true);
}
if ($notnull_bool($ne(tmpleft, left))) {
this.freeTemp((tmpleft && tmpleft.is$Value()));
@@ -13358,15 +13453,15 @@ MethodGenerator.prototype.visitNewExpression = function(node) {
if (node.name != null) {
constructorName = node.name.name;
}
- if ($notnull_bool($eq(constructorName, '') && !(typeRef instanceof GenericTypeReference)) && typeRef.names != null) {
- var names = ListFactory.ListFactory$from$factory(typeRef.names);
+ if ($notnull_bool($notnull_bool($eq(constructorName, '') && !(typeRef instanceof GenericTypeReference)) && $ne(typeRef.get$names(), null))) {
+ var names = ListFactory.ListFactory$from$factory((($0 = typeRef.get$names()) && $0.is$Iterable()));
constructorName = names.removeLast$0().get$name();
- if (names.length == 0) names = null;
- typeRef = new NameTypeReference(typeRef.isFinal, typeRef.get$name(), names, typeRef.get$span());
+ if ($notnull_bool($eq(names.length, 0))) names = null;
+ typeRef = new NameTypeReference(typeRef.get$isFinal(), typeRef.get$name(), names, (($0 = typeRef.get$span()) && $0.is$SourceSpan()));
}
var type = this.method.resolveType(typeRef, true);
if ($notnull_bool(type.get$isTop())) {
- type = type.get$library().findTypeByName($assert_String(constructorName));
+ type = type.get$library().findTypeByName$1(constructorName);
constructorName = '';
}
var m = type.getConstructor$1(constructorName);
@@ -13386,13 +13481,14 @@ MethodGenerator.prototype.visitNewExpression = function(node) {
for (var $i = 0;$i < $list.length; $i++) {
var arg = $list.$index($i);
if (!$notnull_bool(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression())).get$isConst())) {
- world.error('const constructor expects const arguments', arg.get$span());
+ world.error('const constructor expects const arguments', (($0 = arg.get$span()) && $0.is$SourceSpan()));
}
}
}
return m.invoke$4(this, node, null, this._makeArgs(node.arguments));
}
MethodGenerator.prototype.visitListExpression = function(node) {
+ var $0;
var argsCode = [];
var argValues = [];
var $list = node.values;
@@ -13402,15 +13498,15 @@ MethodGenerator.prototype.visitListExpression = function(node) {
argValues.add$1(arg);
if ($notnull_bool(node.isConst)) {
if (!$notnull_bool(arg.get$isConst())) {
- world.error('const list can only contain const values', item.get$span());
- argsCode.add$1(arg.code);
+ world.error('const list can only contain const values', (($0 = item.get$span()) && $0.is$SourceSpan()));
+ argsCode.add$1(arg.get$code());
}
else {
argsCode.add$1(arg.get$canonicalCode());
}
}
else {
- argsCode.add$1(arg.code);
+ argsCode.add$1(arg.get$code());
}
}
world.get$coreimpl().types.$index('ListFactory').markUsed$0();
@@ -13420,7 +13516,7 @@ MethodGenerator.prototype.visitListExpression = function(node) {
var immutableList = world.get$coreimpl().types.$index('ImmutableList');
var immutableListCtor = immutableList.getConstructor$1('from');
var result = immutableListCtor.invoke$4(this, node, null, new Arguments(null, [value]));
- value = world.gen.globalForConst(ConstListValue.ConstListValue$factory((immutableList && immutableList.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), ('const ' + code + ''), $assert_String(result.code), node.span), (argValues && argValues.is$List$Value()));
+ value = world.gen.globalForConst(ConstListValue.ConstListValue$factory((immutableList && immutableList.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), ('const ' + code + ''), $assert_String(result.get$code()), node.span), (argValues && argValues.is$List$Value()));
}
return value;
}
@@ -13438,9 +13534,9 @@ MethodGenerator.prototype.visitMapExpression = function(node) {
argValues.add$1(value);
if ($notnull_bool(node.isConst)) {
if (!$notnull_bool(key.get$isConst()) || !$notnull_bool(value.get$isConst())) {
- world.error('const map can only contain const values', valueItem.get$span());
- argsCode.add$1(key.code);
- argsCode.add$1(value.code);
+ world.error('const map can only contain const values', (($0 = valueItem.get$span()) && $0.is$SourceSpan()));
+ argsCode.add$1(key.get$code());
+ argsCode.add$1(value.get$code());
}
else {
argsCode.add$1(key.get$canonicalCode());
@@ -13448,8 +13544,8 @@ MethodGenerator.prototype.visitMapExpression = function(node) {
}
}
else {
- argsCode.add$1(key.code);
- argsCode.add$1(value.code);
+ argsCode.add$1(key.get$code());
+ argsCode.add$1(value.get$code());
}
}
var argList = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ") + ']');
@@ -13459,7 +13555,7 @@ MethodGenerator.prototype.visitMapExpression = function(node) {
var immutableMapCtor = immutableMap.getConstructor$1('');
var argsValue = new Value(world.listType, argList, node.span, true);
var result = immutableMapCtor.invoke$4(this, node, null, new Arguments(null, [argsValue]));
- var value = ConstMapValue.ConstMapValue$factory((immutableMap && immutableMap.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), code, $assert_String(result.code), node.span);
+ var value = ConstMapValue.ConstMapValue$factory((immutableMap && immutableMap.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), code, $assert_String(result.get$code()), node.span);
return world.gen.globalForConst(value, (argValues && argValues.is$List$Value()));
}
return new Value(mapImplType, code, node.span, true);
@@ -13469,8 +13565,8 @@ MethodGenerator.prototype.visitConditionalExpression = function(node) {
var test = this.visitBool(node.test);
var trueBranch = this.visitValue(node.trueBranch);
var falseBranch = this.visitValue(node.falseBranch);
- var code = ('' + test.code + ' ? ' + trueBranch.code + ' : ' + falseBranch.code + '');
- return new Value(lang_Type.union((($0 = trueBranch.type) && $0.is$lang_Type()), (($0 = falseBranch.type) && $0.is$lang_Type())), code, node.span, true);
+ var code = ('' + test.get$code() + ' ? ' + trueBranch.get$code() + ' : ' + falseBranch.get$code() + '');
+ return new Value(lang_Type.union((($0 = trueBranch.get$type()) && $0.is$lang_Type()), (($0 = falseBranch.get$type()) && $0.is$lang_Type())), code, node.span, true);
}
MethodGenerator.prototype.visitIsExpression = function(node) {
var value = this.visitValue(node.x);
@@ -13481,9 +13577,9 @@ MethodGenerator.prototype.visitParenExpression = function(node) {
var $0;
var body = this.visitValue(node.body);
if ($notnull_bool(body.get$isConst())) {
- return EvaluatedValue.EvaluatedValue$factory((($0 = body.type) && $0.is$lang_Type()), body.get$actualValue(), ('(' + body.get$canonicalCode() + ')'), node.span);
+ return EvaluatedValue.EvaluatedValue$factory((($0 = body.get$type()) && $0.is$lang_Type()), body.get$actualValue(), ('(' + body.get$canonicalCode() + ')'), node.span);
}
- return new Value(body.type, ('(' + body.code + ')'), node.span, true);
+ return new Value(body.get$type(), ('(' + body.get$code() + ')'), node.span, true);
}
MethodGenerator.prototype.visitDotExpression = function(node) {
var target = node.self.visit(this);
@@ -13522,7 +13618,7 @@ MethodGenerator.prototype.visitLiteralExpression = function(node) {
var item = $i.next$0();
var val = this.visitValue((item && item.is$lang_Expression()));
val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
- var code = val.code;
+ var code = val.get$code();
if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpression)) {
code = ('(' + code + ')');
}
@@ -13576,6 +13672,8 @@ Arguments.get$EMPTY = function() {
}
return Arguments._empty;
}
+Arguments.prototype.get$values = function() { return this.values; };
+Arguments.prototype.set$values = function(value) { return this.values = value; };
Arguments.prototype.get$nameCount = function() {
return this.get$length() - this.get$bareCount();
}
@@ -13589,7 +13687,7 @@ Object.defineProperty(Arguments.prototype, "length", {
get: Arguments.prototype.get$length
});
Arguments.prototype.getName = function(i) {
- return this.nodes.$index(i).label.name;
+ return $assert_String(this.nodes.$index(i).get$label().get$name());
}
Arguments.prototype.getIndexOfName = function(name) {
for (var i = this.get$bareCount();
@@ -13611,7 +13709,7 @@ Arguments.prototype.get$bareCount = function() {
if (this.nodes != null) {
for (var i = 0;
i < this.nodes.length; i++) {
- if (this.nodes.$index(i).label != null) {
+ if ($notnull_bool($ne(this.nodes.$index(i).get$label(), null))) {
this._bareCount = i;
break;
}
@@ -13624,7 +13722,7 @@ Arguments.prototype.getCode = function() {
var argsCode = [];
for (var i = 0;
i < this.get$length(); i++) {
- argsCode.add$1(this.values.$index(i).code);
+ argsCode.add$1(this.values.$index(i).get$code());
}
Arguments.removeTrailingNulls((argsCode && argsCode.is$List$Value()));
return Strings.join((argsCode && argsCode.is$List$String()), ", ");
@@ -13662,6 +13760,8 @@ function LibraryImport(library, prefix) {
this.prefix = prefix;
// Initializers done
}
+LibraryImport.prototype.get$prefix = function() { return this.prefix; };
+LibraryImport.prototype.set$prefix = function(value) { return this.prefix = value; };
LibraryImport.prototype.get$library = function() { return this.library; };
LibraryImport.prototype.set$library = function(value) { return this.library = value; };
// ********** Code for Library **************
@@ -13678,8 +13778,13 @@ function Library(baseSource) {
this._privateMembers = $map([]);
}
Library.prototype.is$Library = function(){return this;};
+Library.prototype.get$baseSource = function() { return this.baseSource; };
+Library.prototype.get$types = function() { return this.types; };
+Library.prototype.set$types = function(value) { return this.types = value; };
Library.prototype.get$name = function() { return this.name; };
Library.prototype.set$name = function(value) { return this.name = value; };
+Library.prototype.get$topType = function() { return this.topType; };
+Library.prototype.set$topType = function(value) { return this.topType = value; };
Library.prototype.get$isCore = function() {
return $eq(this, world.corelib);
}
@@ -13787,20 +13892,21 @@ Library.prototype.findType = function(type) {
return result;
}
Library.prototype.findTypeByName = function(name) {
+ var $0;
var ret = this.types.$index(name);
var $list = this.imports;
for (var $i = 0;$i < $list.length; $i++) {
var imported = $list.$index($i);
var newRet = null;
- if (imported.prefix == null) {
- newRet = imported.get$library().types.$index(name);
+ if ($notnull_bool(imported.get$prefix() == null)) {
+ newRet = imported.get$library().get$types().$index(name);
}
- else if (imported.prefix == name) {
- newRet = imported.get$library().topType;
+ else if ($notnull_bool($eq(imported.get$prefix(), name))) {
+ newRet = imported.get$library().get$topType();
}
if ($notnull_bool($ne(newRet, null))) {
if ($notnull_bool($ne(ret, null) && $ne(ret, newRet))) {
- world.error(('conflicting types for "' + name + '"'), ret.get$span(), newRet.get$span());
+ world.error(('conflicting types for "' + name + '"'), (($0 = ret.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceSpan()));
}
else {
ret = newRet;
@@ -13810,6 +13916,7 @@ Library.prototype.findTypeByName = function(name) {
return (ret && ret.is$lang_Type());
}
Library.prototype.lookup = function(name, span) {
+ var $0;
var retType = this.findTypeByName(name);
var ret = null;
if ($notnull_bool($ne(retType, null))) {
@@ -13818,7 +13925,7 @@ Library.prototype.lookup = function(name, span) {
var newRet = this.topType.getMember(name);
if ($notnull_bool($ne(newRet, null))) {
if ($notnull_bool($ne(ret, null) && $ne(ret, newRet))) {
- world.error(('conflicting members for "' + name + '"'), span, ret.get$span(), newRet.get$span());
+ world.error(('conflicting members for "' + name + '"'), span, (($0 = ret.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceSpan()));
}
else {
ret = newRet;
@@ -13827,11 +13934,11 @@ Library.prototype.lookup = function(name, span) {
var $list = this.imports;
for (var $i = 0;$i < $list.length; $i++) {
var imported = $list.$index($i);
- if (imported.prefix == null) {
- newRet = imported.get$library().topType.getMember(name);
+ if ($notnull_bool(imported.get$prefix() == null)) {
+ newRet = imported.get$library().get$topType().getMember$1(name);
if ($notnull_bool($ne(newRet, null))) {
if ($notnull_bool($ne(ret, null) && $ne(ret, newRet))) {
- world.error(('conflicting members for "' + name + '"'), span, ret.get$span(), newRet.get$span());
+ world.error(('conflicting members for "' + name + '"'), span, (($0 = ret.get$span()) && $0.is$SourceSpan()), (($0 = newRet.get$span()) && $0.is$SourceSpan()));
}
else {
ret = newRet;
@@ -13866,6 +13973,9 @@ Library.prototype.visitSources = function() {
Library.prototype.toString = function() {
return this.baseSource.filename;
}
+Library.prototype.findTypeByName$1 = function($0) {
+ return this.findTypeByName($assert_String($0));
+};
Library.prototype.resolve$0 = function() {
return this.resolve();
};
@@ -13897,7 +14007,7 @@ _LibraryVisitor.prototype.addSourceFromName = function(name, span) {
return;
}
else if (this.sources.some((function (s) {
- return s.filename == filename;
+ return $eq(s.get$filename(), filename);
})
)) {
world.error(('file "' + filename + '" has already been sourced'), span);
@@ -13909,7 +14019,7 @@ _LibraryVisitor.prototype.addSourceFromName = function(name, span) {
_LibraryVisitor.prototype.addSource = function(source) {
var $this = this; // closure support
if (this.library.sources.some((function (s) {
- return s.filename == source.filename;
+ return $eq(s.get$filename(), source.filename);
})
)) {
world.error(('duplicate source file "' + source.filename + '"'));
@@ -13972,7 +14082,7 @@ _LibraryVisitor.prototype.visitDirectiveDefinition = function(node) {
if ($notnull_bool($eq(prefix, ''))) prefix = null;
var filename = this.library.makeFullPath($assert_String(name));
if (this.library.imports.some((function (li) {
- return $eq(li.get$library().baseSource, filename);
+ return $eq(li.get$library().get$baseSource(), filename);
})
)) {
world.error(('duplicate import of "' + name + '"'), node.span);
@@ -14020,17 +14130,17 @@ _LibraryVisitor.prototype.getFirstStringArg = function(node) {
world.error(('expected at least one argument but found ' + node.arguments.length + ''), node.span);
}
var arg = node.arguments.$index(0);
- if (arg.label != null) {
+ if ($notnull_bool($ne(arg.get$label(), null))) {
world.error('label not allowed for directive', node.span);
}
return this._parseStringArgument((arg && arg.is$ArgumentNode()));
}
_LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) {
var args = node.arguments.filter((function (a) {
- return a.label != null && a.label.name == argName;
+ return $notnull_bool($ne(a.get$label(), null) && $eq(a.get$label().get$name(), argName));
})
);
- if (args.length == 0) {
+ if ($notnull_bool($eq(args.length, 0))) {
return null;
}
if (args.length > 1) {
@@ -14042,9 +14152,10 @@ _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) {
}
}
_LibraryVisitor.prototype._parseStringArgument = function(arg) {
+ var $0;
var expr = arg.value;
- if (!(expr instanceof LiteralExpression) || !$notnull_bool(expr.type.type.get$isString())) {
- world.error('expected string', expr.get$span());
+ if (!(expr instanceof LiteralExpression) || !$notnull_bool(expr.get$type().get$type().get$isString())) {
+ world.error('expected string', (($0 = expr.get$span()) && $0.is$SourceSpan()));
}
return parseStringLiteral($assert_String(expr.get$value()));
}
@@ -14082,6 +14193,10 @@ Parameter.prototype.get$definition = function() { return this.definition; };
Parameter.prototype.set$definition = function(value) { return this.definition = value; };
Parameter.prototype.get$name = function() { return this.name; };
Parameter.prototype.set$name = function(value) { return this.name = value; };
+Parameter.prototype.get$type = function() { return this.type; };
+Parameter.prototype.set$type = function(value) { return this.type = value; };
+Parameter.prototype.get$isInitializer = function() { return this.isInitializer; };
+Parameter.prototype.set$isInitializer = function(value) { return this.isInitializer = value; };
Parameter.prototype.get$value = function() { return this.value; };
Parameter.prototype.set$value = function(value) { return this.value = value; };
Parameter.prototype.resolve = function(method, inType) {
@@ -14101,7 +14216,7 @@ Parameter.prototype.resolve = function(method, inType) {
if ($notnull_bool(method.get$isAbstract())) {
world.error('default value not allowed on abstract methods', this.definition.span);
}
- else if ($notnull_bool(method.name == '\$call' && method.get$definition().body == null)) {
+ else if ($notnull_bool(method.name == '\$call' && method.get$definition().get$body() == null)) {
world.error('default value not allowed on function type', this.definition.span);
}
}
@@ -14120,9 +14235,9 @@ Parameter.prototype.genValue = function(method, context) {
}
Parameter.prototype.copyWithNewType = function(newType) {
var ret = new Parameter(this.definition);
- ret.type = newType;
- ret.name = this.name;
- ret.isInitializer = this.isInitializer;
+ ret.set$type(newType);
+ ret.set$name(this.name);
+ ret.set$isInitializer(this.isInitializer);
return (ret && ret.is$Parameter());
}
Parameter.prototype.get$isOptional = function() {
@@ -14147,6 +14262,9 @@ function Member(name, declaringType) {
Member.prototype.is$Member = function(){return this;};
Member.prototype.is$Named = function(){return this;};
Member.prototype.get$name = function() { return this.name; };
+Member.prototype.get$declaringType = function() { return this.declaringType; };
+Member.prototype.get$generator = function() { return this.generator; };
+Member.prototype.set$generator = function(value) { return this.generator = value; };
Member.prototype.get$jsname = function() {
return this._jsname == null ? this.name : this._jsname;
}
@@ -14227,8 +14345,9 @@ Member.prototype.canInvoke = function(context, args) {
return $notnull_bool(this.get$canGet() && new Value(this.get$returnType(), null, null, true).canInvoke(context, '\$call', args));
}
Member.prototype.invoke = function(context, node, target, args, isDynamic) {
+ var $0;
var newTarget = this._get(context, node, target, isDynamic);
- return newTarget.invoke$5(context, '\$call', node, args, isDynamic);
+ return (($0 = newTarget.invoke$5(context, '\$call', node, args, isDynamic)) && $0.is$Value());
}
Member.prototype.override = function(other) {
if ($notnull_bool(this.get$isStatic())) {
@@ -14293,6 +14412,7 @@ function TypeMember(type) {
}
$inherits(TypeMember, Member);
TypeMember.prototype.is$TypeMember = function(){return this;};
+TypeMember.prototype.get$type = function() { return this.type; };
TypeMember.prototype.get$span = function() {
return this.type.definition.span;
}
@@ -14316,7 +14436,7 @@ TypeMember.prototype.resolve = function(inType) {
}
TypeMember.prototype._get = function(context, node, target, isDynamic) {
var ret = new Value(this.type, this.type.get$jsname(), node.span, false);
- ret.isType = true;
+ ret.set$isType(true);
return (ret && ret.is$Value());
}
TypeMember.prototype._set = function(context, node, target, value, isDynamic) {
@@ -14360,8 +14480,12 @@ $inherits(FieldMember, Member);
FieldMember.prototype.is$FieldMember = function(){return this;};
FieldMember.prototype.get$definition = function() { return this.definition; };
FieldMember.prototype.get$value = function() { return this.value; };
+FieldMember.prototype.get$type = function() { return this.type; };
+FieldMember.prototype.set$type = function(value) { return this.type = value; };
FieldMember.prototype.get$isStatic = function() { return this.isStatic; };
FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = value; };
+FieldMember.prototype.get$isFinal = function() { return this.isFinal; };
+FieldMember.prototype.set$isFinal = function(value) { return this.isFinal = value; };
FieldMember.prototype.get$isNative = function() { return this.isNative; };
FieldMember.prototype.set$isNative = function(value) { return this.isNative = value; };
FieldMember.prototype.override = function(other) {
@@ -14403,26 +14527,27 @@ FieldMember.prototype.get$isField = function() {
return true;
}
FieldMember.prototype.resolve = function(inType) {
+ var $0;
this.isStatic = this.declaringType.get$isTop();
this.isFinal = false;
if (this.definition.modifiers != null) {
var $list = this.definition.modifiers;
for (var $i = 0;$i < $list.length; $i++) {
var mod = $list.$index($i);
- if ($notnull_bool($eq(mod.kind, 86/*TokenKind.STATIC*/))) {
+ if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) {
if ($notnull_bool(this.isStatic)) {
- world.error('duplicate static modifier', mod.get$span());
+ world.error('duplicate static modifier', (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
this.isStatic = true;
}
- else if ($notnull_bool($eq(mod.kind, 97/*TokenKind.FINAL*/))) {
+ else if ($notnull_bool($eq(mod.get$kind(), 97/*TokenKind.FINAL*/))) {
if ($notnull_bool(this.isFinal)) {
- world.error('duplicate final modifier', mod.get$span());
+ world.error('duplicate final modifier', (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
this.isFinal = true;
}
else {
- world.error(('' + mod + ' modifier not allowed on field'), mod.get$span());
+ world.error(('' + mod + ' modifier not allowed on field'), (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
}
}
@@ -14445,7 +14570,7 @@ FieldMember.prototype.computeValue = function() {
}
this._computing = true;
var finalMethod = new MethodMember('final_context', this.declaringType, null);
- finalMethod.isStatic = true;
+ finalMethod.set$isStatic(true);
var finalGen = new MethodGenerator(finalMethod, null);
this._computedValue = (($0 = this.value.visit(finalGen)) && $0.is$Value());
if (!$notnull_bool(this._computedValue.get$isConst())) {
@@ -14481,11 +14606,11 @@ FieldMember.prototype._get = function(context, node, target, isDynamic) {
}
}
else if ($notnull_bool(target.get$isConst() && this.isFinal)) {
- var constTarget = (target instanceof GlobalValue) ? target.get$dynamic().exp : target;
+ var constTarget = (target instanceof GlobalValue) ? target.get$dynamic().get$exp() : target;
if ((constTarget instanceof ConstObjectValue)) {
- return (($0 = constTarget.fields.$index(this.name)) && $0.is$Value());
+ return (($0 = constTarget.get$fields().$index(this.name)) && $0.is$Value());
}
- else if ($notnull_bool($eq(constTarget.type, world.stringType) && this.name == 'length')) {
+ else if ($notnull_bool($eq(constTarget.get$type(), world.stringType) && this.name == 'length')) {
return new Value(this.type, ('' + constTarget.get$actualValue().length + ''), node.span, true);
}
}
@@ -14494,7 +14619,7 @@ FieldMember.prototype._get = function(context, node, target, isDynamic) {
FieldMember.prototype._set = function(context, node, target, value, isDynamic) {
var lhs = this._get(context, node, target, isDynamic);
value = value.convertTo(context, this.type, node, isDynamic);
- return new Value(this.type, ('' + lhs.code + ' = ' + value.code + ''), node.span, true);
+ return new Value(this.type, ('' + lhs.get$code() + ' = ' + value.code + ''), node.span, true);
}
FieldMember.prototype._get$3 = function($0, $1, $2) {
return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), false);
@@ -14522,6 +14647,10 @@ function PropertyMember(name, declaringType) {
}
$inherits(PropertyMember, Member);
PropertyMember.prototype.is$PropertyMember = function(){return this;};
+PropertyMember.prototype.get$getter = function() { return this.getter; };
+PropertyMember.prototype.set$getter = function(value) { return this.getter = value; };
+PropertyMember.prototype.get$setter = function() { return this.setter; };
+PropertyMember.prototype.set$setter = function(value) { return this.setter = value; };
PropertyMember.prototype.get$span = function() {
var $0;
return (($0 = this.getter != null ? this.getter.get$span() : null) && $0.is$SourceSpan());
@@ -14626,8 +14755,8 @@ function ConcreteMember(name, declaringType, baseMember) {
var $list = this.baseMember.get$parameters();
for (var $i = 0;$i < $list.length; $i++) {
var p = $list.$index($i);
- var newType = p.type.resolveTypeParams$1(declaringType);
- if ($notnull_bool($ne(newType, p.type))) {
+ var newType = p.get$type().resolveTypeParams$1(declaringType);
+ if ($notnull_bool($ne(newType, p.get$type()))) {
this.parameters.add(p.copyWithNewType$1(newType));
}
else {
@@ -14788,6 +14917,8 @@ MethodMember.prototype.get$isConst = function() { return this.isConst; };
MethodMember.prototype.set$isConst = function(value) { return this.isConst = value; };
MethodMember.prototype.get$isFactory = function() { return this.isFactory; };
MethodMember.prototype.set$isFactory = function(value) { return this.isFactory = value; };
+MethodMember.prototype.get$isLambda = function() { return this.isLambda; };
+MethodMember.prototype.set$isLambda = function(value) { return this.isLambda = value; };
MethodMember.prototype.get$initDelegate = function() { return this.initDelegate; };
MethodMember.prototype.set$initDelegate = function(value) { return this.initDelegate = value; };
MethodMember.prototype.get$isConstructor = function() {
@@ -14898,7 +15029,7 @@ MethodMember.prototype.namesInOrder = function(args) {
for (var i = args.get$bareCount();
i < this.parameters.length; i++) {
var p = args.getIndexOfName($assert_String(this.parameters.$index(i).get$name()));
- if ($notnull_bool(p >= 0 && args.values.$index(p).needsTemp)) {
+ if ($notnull_bool(p >= 0 && args.values.$index(p).get$needsTemp())) {
if (lastParameter != null && lastParameter > $assert_num(p)) {
return false;
}
@@ -14912,7 +15043,7 @@ MethodMember.prototype.needsArgumentConversion = function(args) {
for (var i = 0;
i < bareCount; i++) {
var arg = args.values.$index(i);
- if ($notnull_bool(arg.needsConversion$1(this.parameters.$index(i).type))) {
+ if ($notnull_bool(arg.needsConversion$1(this.parameters.$index(i).get$type()))) {
return false;
}
}
@@ -14921,7 +15052,7 @@ MethodMember.prototype.needsArgumentConversion = function(args) {
for (var i = bareCount;
i < this.parameters.length; i++) {
var arg = args.getValue($assert_String(this.parameters.$index(i).get$name()));
- if ($notnull_bool($ne(arg, null) && arg.needsConversion$1(this.parameters.$index(i).type))) {
+ if ($notnull_bool($ne(arg, null) && arg.needsConversion$1(this.parameters.$index(i).get$type()))) {
return false;
}
}
@@ -14948,6 +15079,7 @@ MethodMember.prototype.genParameterValues = function() {
}
}
MethodMember.prototype.invoke = function(context, node, target, args, isDynamic) {
+ var $0;
if (this.parameters == null) {
world.info(('surprised to need to resolve: ' + this.declaringType.name + '.' + this.name + ''));
this.resolve(this.declaringType);
@@ -14972,12 +15104,12 @@ MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
var msg = MethodMember._argCountMsg(args.get$length(), this.parameters.length, false);
return this._argError(context, node, target, args, $assert_String(msg));
}
- arg = arg.convertTo$4(context, this.parameters.$index(i).type, node, isDynamic);
+ arg = arg.convertTo$4(context, this.parameters.$index(i).get$type(), node, isDynamic);
if ($notnull_bool(this.isConst && arg.get$isConst())) {
argsCode.add$1(arg.get$canonicalCode());
}
else {
- argsCode.add$1(arg.code);
+ argsCode.add$1(arg.get$code());
}
}
if (bareCount < this.parameters.length) {
@@ -14990,7 +15122,7 @@ MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
arg = this.parameters.$index(i).get$value();
}
else {
- arg = arg.convertTo$4(context, this.parameters.$index(i).type, node, isDynamic);
+ arg = arg.convertTo$4(context, this.parameters.$index(i).get$type(), node, isDynamic);
namedArgsUsed++;
}
if ($notnull_bool(arg == null || !$notnull_bool(this.parameters.$index(i).get$isOptional()))) {
@@ -14998,7 +15130,7 @@ MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
return this._argError(context, node, target, args, $assert_String(msg));
}
else {
- argsCode.add$1($notnull_bool(this.isConst && arg.get$isConst()) ? arg.get$canonicalCode() : arg.code);
+ argsCode.add$1($notnull_bool(this.isConst && arg.get$isConst()) ? arg.get$canonicalCode() : arg.get$code());
}
}
if (namedArgsUsed < args.get$nameCount()) {
@@ -15044,16 +15176,16 @@ MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
var code = ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ')');
if ($notnull_bool(target.get$isConst())) {
if ((target instanceof GlobalValue)) {
- target = target.get$dynamic().exp;
+ target = (($0 = target.get$dynamic().get$exp()) && $0.is$Value());
}
if (this.name == 'get\$length') {
if ((target instanceof ConstListValue) || (target instanceof ConstMapValue)) {
- code = ('' + target.get$dynamic().values.length + '');
+ code = ('' + target.get$dynamic().get$values().length + '');
}
}
else if (this.name == 'isEmpty') {
if ((target instanceof ConstListValue) || (target instanceof ConstMapValue)) {
- code = ('' + target.get$dynamic().values.isEmpty$0() + '');
+ code = ('' + target.get$dynamic().get$values().isEmpty$0() + '');
}
}
}
@@ -15084,7 +15216,7 @@ MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar
for (var i = 0;
i < this.parameters.length; i++) {
var param = this.parameters.$index(i);
- if ($notnull_bool(param.isInitializer)) {
+ if ($notnull_bool(param.get$isInitializer())) {
var value = null;
if (i < args.get$length()) {
value = args.values.$index(i);
@@ -15121,17 +15253,17 @@ MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar
if ((init instanceof CallExpression)) {
var delegateArgs = this.generator._makeArgs((($0 = init.get$arguments()) && $0.is$List$ArgumentNode()));
var value = this.initDelegate.invoke(this.generator, node, target, delegateArgs, false);
- if ((init.target instanceof ThisExpression)) {
+ if ((init.get$target() instanceof ThisExpression)) {
return (value && value.is$Value());
}
else {
if ((value instanceof GlobalValue)) {
- value = value.exp;
+ value = value.get$exp();
}
- var $list0 = value.fields.getKeys();
- for (var $i0 = value.fields.getKeys().iterator$0(); $i0.hasNext$0(); ) {
+ var $list0 = value.get$fields().getKeys$0();
+ for (var $i0 = value.get$fields().getKeys$0().iterator$0(); $i0.hasNext$0(); ) {
var fname = $i0.next$0();
- fields.$setindex(fname, value.fields.$index(fname));
+ fields.$setindex(fname, value.get$fields().$index(fname));
}
}
}
@@ -15301,7 +15433,7 @@ MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar
var val0 = target.get$dynamic().get$actualValue();
val0 = val0.substring$2(1, val0.length - 1);
var val1 = args.values.$index(0).get$dynamic().get$actualValue();
- if ($notnull_bool(args.values.$index(0).type.get$isString())) {
+ if ($notnull_bool(args.values.$index(0).get$type().get$isString())) {
val1 = val1.substring$2(1, val1.length - 1);
}
var value = ('' + val0 + '' + val1 + '');
@@ -15354,6 +15486,7 @@ MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar
return new Value(this.get$inferredResult(), ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ')'), node.span, true);
}
MethodMember.prototype.resolve = function(inType) {
+ var $0;
this.isStatic = inType.get$isTop();
this.isConst = false;
this.isFactory = false;
@@ -15362,37 +15495,37 @@ MethodMember.prototype.resolve = function(inType) {
var $list = this.definition.modifiers;
for (var $i = 0;$i < $list.length; $i++) {
var mod = $list.$index($i);
- if ($notnull_bool($eq(mod.kind, 86/*TokenKind.STATIC*/))) {
+ if ($notnull_bool($eq(mod.get$kind(), 86/*TokenKind.STATIC*/))) {
if ($notnull_bool(this.isStatic)) {
- world.error('duplicate static modifier', mod.get$span());
+ world.error('duplicate static modifier', (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
this.isStatic = true;
}
- else if ($notnull_bool(this.get$isConstructor() && $eq(mod.kind, 91/*TokenKind.CONST*/))) {
+ else if ($notnull_bool(this.get$isConstructor() && $eq(mod.get$kind(), 91/*TokenKind.CONST*/))) {
if ($notnull_bool(this.isConst)) {
- world.error('duplicate const modifier', mod.get$span());
+ world.error('duplicate const modifier', (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
this.isConst = true;
}
- else if ($notnull_bool($eq(mod.kind, 75/*TokenKind.FACTORY*/))) {
+ else if ($notnull_bool($eq(mod.get$kind(), 75/*TokenKind.FACTORY*/))) {
if ($notnull_bool(this.isFactory)) {
- world.error('duplicate factory modifier', mod.get$span());
+ world.error('duplicate factory modifier', (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
this.isFactory = true;
}
- else if ($notnull_bool($eq(mod.kind, 71/*TokenKind.ABSTRACT*/))) {
+ else if ($notnull_bool($eq(mod.get$kind(), 71/*TokenKind.ABSTRACT*/))) {
if ($notnull_bool(this.isAbstract)) {
if ($notnull_bool(this.declaringType.get$isClass())) {
- world.error('duplicate abstract modifier', mod.get$span());
+ world.error('duplicate abstract modifier', (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
else {
- world.error('abstract modifier not allowed on interface members', mod.get$span());
+ world.error('abstract modifier not allowed on interface members', (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
}
this.isAbstract = true;
}
else {
- world.error(('' + mod + ' modifier not allowed on method'), mod.get$span());
+ world.error(('' + mod + ' modifier not allowed on method'), (($0 = mod.get$span()) && $0.is$SourceSpan()));
}
}
}
@@ -15495,7 +15628,7 @@ MemberSet.prototype.get$isStatic = function() {
return $notnull_bool(this.members.length == 1 && this.members.$index(0).get$isStatic());
}
MemberSet.prototype.get$isOperator = function() {
- return this.members.$index(0).get$isOperator();
+ return $assert_bool(this.members.$index(0).get$isOperator());
}
MemberSet.prototype.canInvoke = function(context, args) {
return this.members.some((function (m) {
@@ -15511,7 +15644,7 @@ MemberSet.prototype._makeError = function(node, target, action) {
}
MemberSet.prototype.get$treatAsField = function() {
if (this._treatAsField == null) {
- this._treatAsField = true;
+ this._treatAsField = !$notnull_bool(this.isVar);
var $list = this.members;
for (var $i = 0;$i < $list.length; $i++) {
var member = $list.$index($i);
@@ -15537,24 +15670,33 @@ MemberSet.prototype.get$treatAsField = function() {
return this._treatAsField;
}
MemberSet.prototype._get = function(context, node, target, isDynamic) {
- if (this.members.length == 1) {
- return this.members.$index(0)._get(context, node, target, isDynamic);
- }
+ var returnValue;
var targets = this.members.filter((function (m) {
return m.get$canGet();
})
);
- if (targets.length == 1) {
- return targets.$index(0)._get(context, node, target, isDynamic);
- }
- var returnValue = null;
- for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
- var member = $i.next$0();
- var value = member._get(context, node, target, true);
- returnValue = this._tryUnion(returnValue, value, node);
+ if ($notnull_bool(this.isVar)) {
+ targets.forEach$1((function (m) {
+ return m._get(context, node, target, true);
+ })
+ );
+ returnValue = new Value(this._foldTypes((targets && targets.is$List$Member())), null, node.span, true);
}
- if (returnValue == null) {
- return this._makeError(node, target, 'getter');
+ else {
+ if (this.members.length == 1) {
+ return this.members.$index(0)._get(context, node, target, isDynamic);
+ }
+ else if ($notnull_bool($eq(targets.length, 1))) {
+ return targets.$index(0)._get(context, node, target, isDynamic);
+ }
+ for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
+ var member = $i.next$0();
+ var value = member._get(context, node, target, true);
+ returnValue = this._tryUnion(returnValue, value, node);
+ }
+ if (returnValue == null) {
+ return this._makeError(node, target, 'getter');
+ }
}
if (returnValue.code == null) {
if ($notnull_bool(this.get$treatAsField())) {
@@ -15567,24 +15709,33 @@ MemberSet.prototype._get = function(context, node, target, isDynamic) {
return returnValue;
}
MemberSet.prototype._set = function(context, node, target, value, isDynamic) {
- if (this.members.length == 1) {
- return this.members.$index(0)._set(context, node, target, value, isDynamic);
- }
+ var returnValue;
var targets = this.members.filter((function (m) {
return m.get$canSet();
})
);
- if (targets.length == 1) {
- return targets.$index(0)._set(context, node, target, value, isDynamic);
- }
- var returnValue = null;
- for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
- var member = $i.next$0();
- var res = member._set(context, node, target, value, true);
- returnValue = this._tryUnion(returnValue, res, node);
+ if ($notnull_bool(this.isVar)) {
+ targets.forEach$1((function (m) {
+ return m._set(context, node, target, value, true);
+ })
+ );
+ returnValue = new Value(this._foldTypes((targets && targets.is$List$Member())), null, node.span, true);
}
- if (returnValue == null) {
- return this._makeError(node, target, 'setter');
+ else {
+ if (this.members.length == 1) {
+ return this.members.$index(0)._set(context, node, target, value, isDynamic);
+ }
+ else if ($notnull_bool($eq(targets.length, 1))) {
+ return targets.$index(0)._set(context, node, target, value, isDynamic);
+ }
+ for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
+ var member = $i.next$0();
+ var res = member._set(context, node, target, value, true);
+ returnValue = this._tryUnion(returnValue, res, node);
+ }
+ if (returnValue == null) {
+ return this._makeError(node, target, 'setter');
+ }
}
if (returnValue.code == null) {
if ($notnull_bool(this.get$treatAsField())) {
@@ -15602,20 +15753,20 @@ MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) {
return this.invokeOnVar(context, node, target, args);
}
if (this.members.length == 1) {
- return this.members.$index(0).invoke$5(context, node, target, args, isDynamic);
+ return (($0 = this.members.$index(0).invoke$5(context, node, target, args, isDynamic)) && $0.is$Value());
}
var targets = this.members.filter((function (m) {
return m.canInvoke$2(context, args);
})
);
- if (targets.length == 1) {
+ if ($notnull_bool($eq(targets.length, 1))) {
return (($0 = targets.$index(0).invoke$5(context, node, target, args, isDynamic)) && $0.is$Value());
}
var returnValue = null;
for (var $i = targets.iterator$0(); $i.hasNext$0(); ) {
var member = $i.next$0();
var res = member.invoke$4$isDynamic(context, node, target, args, true);
- returnValue = this._tryUnion(returnValue, res, node);
+ returnValue = this._tryUnion(returnValue, (res && res.is$Value()), node);
}
if (returnValue == null) {
return this._makeError(node, target, 'method');
@@ -15631,8 +15782,9 @@ MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) {
return returnValue;
}
MemberSet.prototype.invokeOnVar = function(context, node, target, args) {
+ var $0;
var member = this.getVarMember(context, node, args);
- return member.invoke$4(context, node, target, args);
+ return (($0 = member.invoke$4(context, node, target, args)) && $0.is$Value());
}
MemberSet.prototype._tryUnion = function(x, y, node) {
if (x == null) return y;
@@ -15646,9 +15798,9 @@ MemberSet.prototype._tryUnion = function(x, y, node) {
}
else {
var ret = new Value(type, x.code, node.span, true);
- ret.isSuper = $notnull_bool(x.isSuper && y.isSuper);
- ret.needsTemp = $notnull_bool(x.needsTemp || y.needsTemp);
- ret.isType = $notnull_bool(x.isType && y.isType);
+ ret.set$isSuper($notnull_bool(x.isSuper && y.isSuper));
+ ret.set$needsTemp($notnull_bool(x.needsTemp || y.needsTemp));
+ ret.set$isType($notnull_bool(x.isType && y.isType));
return (ret && ret.is$Value());
}
}
@@ -15668,15 +15820,18 @@ MemberSet.prototype.getVarMember = function(context, node, args) {
return m.canInvoke$2(context, args);
})
);
- var returnType = reduce(map((targets && targets.is$Iterable()), (function (t) {
- return t.get$returnType();
- })
- ), lang_Type.union);
- stub = new VarMethodSet($assert_String(stubName), targets, args, returnType);
+ stub = new VarMethodSet($assert_String(stubName), targets, args, this._foldTypes((targets && targets.is$List$Member())));
world.objectType.varStubs.$setindex(stubName, stub);
}
return (stub && stub.is$VarMember());
}
+MemberSet.prototype._foldTypes = function(targets) {
+ var $0;
+ return (($0 = reduce(map(targets, (function (t) {
+ return t.get$returnType();
+ })
+ ), lang_Type.union, world.varType)) && $0.is$lang_Type());
+}
MemberSet.prototype._get$3 = function($0, $1, $2) {
return this._get(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), false);
};
@@ -15730,6 +15885,7 @@ FactoryMap.prototype.forEach = function(f) {
})
);
}
+FactoryMap.prototype.forEach$1 = FactoryMap.prototype.forEach;
FactoryMap.prototype.getFactory$2 = function($0, $1) {
return this.getFactory($assert_String($0), $assert_String($1));
};
@@ -15741,6 +15897,9 @@ function lang_Token(kind, source, start, end) {
this.end = end;
// Initializers done
}
+lang_Token.prototype.get$kind = function() { return this.kind; };
+lang_Token.prototype.get$end = function() { return this.end; };
+lang_Token.prototype.get$start = function() { return this.start; };
lang_Token.prototype.get$text = function() {
return this.source.get$text().substring(this.start, this.end);
}
@@ -15771,6 +15930,9 @@ function SourceFile(filename, _text) {
}
SourceFile.prototype.is$SourceFile = function(){return this;};
SourceFile.prototype.is$Comparable = function(){return this;};
+SourceFile.prototype.get$filename = function() { return this.filename; };
+SourceFile.prototype.get$orderInLibrary = function() { return this.orderInLibrary; };
+SourceFile.prototype.set$orderInLibrary = function(value) { return this.orderInLibrary = value; };
SourceFile.prototype.get$text = function() {
return this._text;
}
@@ -15791,7 +15953,7 @@ SourceFile.prototype.get$lineStarts = function() {
SourceFile.prototype.getLine = function(position) {
var starts = this.get$lineStarts();
for (var i = 0;
- i < starts.length; i++) {
+ i < $assert_num(starts.length); i++) {
if (starts.$index(i) > position) return i - 1;
}
world.internalError('bad position');
@@ -15817,7 +15979,7 @@ SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
for (; i < $assert_num(column); i++) {
buf.add$1(' ');
}
- var toColumn = Math.min($assert_num(column + (end - start)), textLine.length);
+ var toColumn = Math.min($assert_num(column + (end - start)), $assert_num(textLine.length));
for (; i < toColumn; i++) {
buf.add$1('^');
}
@@ -15835,6 +15997,12 @@ SourceFile.prototype.compareTo = function(other) {
SourceFile.prototype.compareTo$1 = function($0) {
return this.compareTo(($0 && $0.is$SourceFile()));
};
+SourceFile.prototype.getColumn$2 = function($0, $1) {
+ return this.getColumn($assert_num($0), $assert_num($1));
+};
+SourceFile.prototype.getLine$1 = function($0) {
+ return this.getLine($assert_num($0));
+};
// ********** Code for SourceSpan **************
function SourceSpan(file, start, end) {
this.file = file;
@@ -15844,6 +16012,9 @@ function SourceSpan(file, start, end) {
}
SourceSpan.prototype.is$SourceSpan = function(){return this;};
SourceSpan.prototype.is$Comparable = function(){return this;};
+SourceSpan.prototype.get$file = function() { return this.file; };
+SourceSpan.prototype.get$start = function() { return this.start; };
+SourceSpan.prototype.get$end = function() { return this.end; };
SourceSpan.prototype.get$text = function() {
return this.file.get$text().substring(this.start, this.end);
}
@@ -15874,12 +16045,18 @@ function InterpStack(previous, quote, isMultiline) {
// Initializers done
}
InterpStack.prototype.is$InterpStack = function(){return this;};
+InterpStack.prototype.get$previous = function() { return this.previous; };
+InterpStack.prototype.set$previous = function(value) { return this.previous = value; };
+InterpStack.prototype.get$quote = function() { return this.quote; };
+InterpStack.prototype.get$isMultiline = function() { return this.isMultiline; };
+InterpStack.prototype.get$depth = function() { return this.depth; };
+InterpStack.prototype.set$depth = function(value) { return this.depth = value; };
InterpStack.prototype.pop = function() {
return this.previous;
}
InterpStack.push = function(stack, quote, isMultiline) {
var newStack = new InterpStack(stack, quote, isMultiline);
- if (stack != null) newStack.previous = stack;
+ if (stack != null) newStack.set$previous(stack);
return (newStack && newStack.is$InterpStack());
}
InterpStack.prototype.next$0 = function() {
@@ -16230,11 +16407,11 @@ Tokenizer.prototype.next = function() {
if (this._interpStack != null && this._interpStack.depth == 0) {
var istack = this._interpStack;
this._interpStack = this._interpStack.pop();
- if ($notnull_bool(istack.isMultiline)) {
- return this.finishMultilineString(istack.quote);
+ if ($notnull_bool(istack.get$isMultiline())) {
+ return this.finishMultilineString($assert_num(istack.get$quote()));
}
else {
- return this.finishStringBody(istack.quote);
+ return this.finishStringBody($assert_num(istack.get$quote()));
}
}
var ch;
@@ -17628,10 +17805,11 @@ lang_Parser.prototype._eatSemicolon = function() {
this._eat(10/*TokenKind.SEMICOLON*/);
}
lang_Parser.prototype._errorExpected = function(expected) {
+ var $0;
if ($notnull_bool(this.throwOnIncomplete)) this.isPrematureEndOfFile();
var tok = this._lang_next();
var message = ('expected ' + expected + ', but found ' + tok + '');
- this._lang_error($assert_String(message), tok.get$span());
+ this._lang_error($assert_String(message), (($0 = tok.get$span()) && $0.is$SourceSpan()));
}
lang_Parser.prototype._lang_error = function(message, location) {
if (location == null) {
@@ -17640,19 +17818,20 @@ lang_Parser.prototype._lang_error = function(message, location) {
world.fatal(message, location);
}
lang_Parser.prototype._skipBlock = function() {
+ var $0;
var depth = 1;
this._eat(6/*TokenKind.LBRACE*/);
while (true) {
var tok = this._lang_next();
- if ($notnull_bool($eq(tok.kind, 6/*TokenKind.LBRACE*/))) {
+ if ($notnull_bool($eq(tok.get$kind(), 6/*TokenKind.LBRACE*/))) {
depth += 1;
}
- else if ($notnull_bool($eq(tok.kind, 7/*TokenKind.RBRACE*/))) {
+ else if ($notnull_bool($eq(tok.get$kind(), 7/*TokenKind.RBRACE*/))) {
depth -= 1;
if (depth == 0) return;
}
- else if ($notnull_bool($eq(tok.kind, 1/*TokenKind.END_OF_FILE*/))) {
- this._lang_error('unexpected end of file during diet parse', tok.get$span());
+ else if ($notnull_bool($eq(tok.get$kind(), 1/*TokenKind.END_OF_FILE*/))) {
+ this._lang_error('unexpected end of file during diet parse', (($0 = tok.get$span()) && $0.is$SourceSpan()));
return;
}
}
@@ -17745,7 +17924,7 @@ lang_Parser.prototype.functionTypeAlias = function() {
}
var formals = this.formalParameterList();
this._eatSemicolon();
- var func = new FunctionDefinition(null, di.type, di.get$name(), formals, null, null, this._makeSpan(start));
+ var func = new FunctionDefinition(null, di.get$type(), di.get$name(), formals, null, null, this._makeSpan(start));
return new FunctionTypeDefinition(func, typeParams, this._makeSpan(start));
}
lang_Parser.prototype.initializers = function() {
@@ -17758,6 +17937,9 @@ lang_Parser.prototype.initializers = function() {
this._inInitializers = false;
return ret;
}
+lang_Parser.prototype.get$initializers = function() {
+ return lang_Parser.prototype.initializers.bind(this);
+}
lang_Parser.prototype.functionBody = function(inExpression) {
var start = this._peekToken.start;
if ($notnull_bool(this._maybeEat(9/*TokenKind.ARROW*/))) {
@@ -17819,20 +18001,20 @@ lang_Parser.prototype.finishDefinition = function(start, modifiers, di) {
}
var body = this.functionBody(false);
if ($notnull_bool(di.get$name() == null)) {
- di.name = di.type.get$name();
+ di.set$name(di.get$type().get$name());
}
- return new FunctionDefinition(modifiers, di.type, di.get$name(), formals, inits, body, this._makeSpan($assert_num(start)));
+ return new FunctionDefinition(modifiers, di.get$type(), di.get$name(), formals, inits, body, this._makeSpan($assert_num(start)));
case 20/*TokenKind.ASSIGN*/:
this._eat(20/*TokenKind.ASSIGN*/);
var value = this.expression();
- return this.finishField(start, modifiers, di.type, di.get$name(), value);
+ return this.finishField(start, modifiers, di.get$type(), di.get$name(), value);
case 11/*TokenKind.COMMA*/:
case 10/*TokenKind.SEMICOLON*/:
- return this.finishField(start, modifiers, di.type, di.get$name(), null);
+ return this.finishField(start, modifiers, di.get$type(), di.get$name(), null);
default:
@@ -17850,6 +18032,7 @@ lang_Parser.prototype.declaration = function(includeOperators) {
return this.finishDefinition(start, modifiers, this.declaredIdentifier(includeOperators));
}
lang_Parser.prototype.factoryConstructorDeclaration = function() {
+ var $0;
var start = this._peekToken.start;
var factoryToken = this._lang_next();
var names = [this.identifier()];
@@ -17870,16 +18053,16 @@ lang_Parser.prototype.factoryConstructorDeclaration = function() {
name = names.removeLast$0();
}
else {
- name = new lang_Identifier('', names.$index(0).get$span());
+ name = new lang_Identifier('', (($0 = names.$index(0).get$span()) && $0.is$SourceSpan()));
}
}
else {
- name = new lang_Identifier('', names.$index(0).get$span());
+ name = new lang_Identifier('', (($0 = names.$index(0).get$span()) && $0.is$SourceSpan()));
}
if (names.length > 1) {
- this._lang_error('unsupported qualified name for factory', names.$index(0).get$span());
+ this._lang_error('unsupported qualified name for factory', (($0 = names.$index(0).get$span()) && $0.is$SourceSpan()));
}
- type = new NameTypeReference(false, names.$index(0), null, names.$index(0).get$span());
+ type = new NameTypeReference(false, names.$index(0), null, (($0 = names.$index(0).get$span()) && $0.is$SourceSpan()));
var di = new DeclaredIdentifier(type, name, this._makeSpan(start));
return this.finishDefinition(start, [factoryToken], di);
}
@@ -17954,43 +18137,43 @@ lang_Parser.prototype.statement = function() {
}
lang_Parser.prototype.finishExpressionAsStatement = function(expr) {
var $0;
- var start = expr.get$span().start;
+ var start = $assert_num(expr.get$span().get$start());
if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
var label = this._makeLabel(expr);
return new LabeledStatement(label, this.statement(), this._makeSpan(start));
}
if ((expr instanceof LambdaExpression)) {
- if (!(expr.func.body instanceof BlockStatement)) {
+ if (!(expr.get$func().get$body() instanceof BlockStatement)) {
this._eatSemicolon();
- expr.func.span = this._makeSpan(start);
+ expr.get$func().set$span(this._makeSpan(start));
}
- return expr.func;
+ return expr.get$func();
}
else if ((expr instanceof DeclaredIdentifier)) {
var value = null;
if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
value = this.expression();
}
- return this.finishField(start, null, expr.type, expr.get$name(), value);
+ return this.finishField(start, null, expr.get$type(), expr.get$name(), value);
}
- else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.x instanceof DeclaredIdentifier)))) {
- var di = (($0 = expr.x) && $0.is$DeclaredIdentifier());
- return this.finishField(start, null, di.type, di.name, expr.y);
+ else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.get$x() instanceof DeclaredIdentifier)))) {
+ var di = (($0 = expr.get$x()) && $0.is$DeclaredIdentifier());
+ return this.finishField(start, null, di.type, di.name, expr.get$y());
}
else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/) && this._maybeEat(11/*TokenKind.COMMA*/))) {
- var baseType = this._makeType(expr.x);
- var typeArgs = [this._makeType(expr.y)];
+ var baseType = this._makeType(expr.get$x());
+ var typeArgs = [this._makeType(expr.get$y())];
var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference()), 0, typeArgs);
var name = this.identifier();
var value = null;
if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
value = this.expression();
}
- return this.finishField(expr.get$span().start, null, gt, name, value);
+ return this.finishField(expr.get$span().get$start(), null, gt, name, value);
}
else {
this._eatSemicolon();
- return new lang_ExpressionStatement(expr, this._makeSpan(expr.get$span().start));
+ return new lang_ExpressionStatement(expr, this._makeSpan($assert_num(expr.get$span().get$start())));
}
}
lang_Parser.prototype.testCondition = function() {
@@ -18074,11 +18257,11 @@ lang_Parser.prototype.forInitializerStatement = function(start) {
var init = this.expression();
if ($notnull_bool(this._peekKind(11/*TokenKind.COMMA*/) && this._isBin(init, 52/*TokenKind.LT*/))) {
this._eat(11/*TokenKind.COMMA*/);
- var baseType = this._makeType(init.x);
- var typeArgs = [this._makeType(init.y)];
+ var baseType = this._makeType(init.get$x());
+ var typeArgs = [this._makeType(init.get$y())];
var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference()), 0, typeArgs);
var name = this.identifier();
- init = new DeclaredIdentifier(gt, name, this._makeSpan(init.get$span().start));
+ init = new DeclaredIdentifier(gt, name, this._makeSpan($assert_num(init.get$span().get$start())));
}
if ($notnull_bool(this._maybeEat(101/*TokenKind.IN*/))) {
return this._finishForIn(start, (($0 = this._makeDeclaredIdentifier(init)) && $0.is$DeclaredIdentifier()));
@@ -18157,7 +18340,7 @@ lang_Parser.prototype.caseNode = function() {
break;
}
}
- if (cases.length == 0) {
+ if ($notnull_bool($eq(cases.length, 0))) {
this._lang_error('case or default');
}
var stmts = [];
@@ -18226,18 +18409,19 @@ lang_Parser.prototype.expression = function() {
return this.infixExpression(0);
}
lang_Parser.prototype._makeType = function(expr) {
+ var $0;
if ((expr instanceof VarExpression)) {
- return new NameTypeReference(false, expr.get$name(), null, expr.get$span());
+ return new NameTypeReference(false, expr.get$name(), null, (($0 = expr.get$span()) && $0.is$SourceSpan()));
}
else if ((expr instanceof DotExpression)) {
- var type = this._makeType(expr.self);
- if (type.names == null) {
- type.names = [expr.get$name()];
+ var type = this._makeType(expr.get$self());
+ if (type.get$names() == null) {
+ type.set$names([expr.get$name()]);
}
else {
- type.names.add(expr.get$name());
+ type.get$names().add$1(expr.get$name());
}
- type.span = expr.get$span();
+ type.set$span(expr.get$span());
return type;
}
else {
@@ -18251,7 +18435,7 @@ lang_Parser.prototype.infixExpression = function(precedence) {
}
lang_Parser.prototype._finishDeclaredId = function(type) {
var name = this.identifier();
- return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._makeSpan(type.get$span().start)));
+ return this.finishPostfixExpression(new DeclaredIdentifier(type, name, this._makeSpan($assert_num(type.get$span().get$start()))));
}
lang_Parser.prototype._fixAsType = function(x) {
$assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser.dart", 790, 12);
@@ -18267,7 +18451,7 @@ lang_Parser.prototype._fixAsType = function(x) {
var paramBase = this._makeType(x.y);
var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeReference()), 1);
var type;
- if (firstParam.depth <= 0) {
+ if (firstParam.get$depth() <= 0) {
type = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.span.start));
}
else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
@@ -18291,14 +18475,14 @@ lang_Parser.prototype.finishInfixExpression = function(x, precedence) {
}
}
var op = this._lang_next();
- if ($notnull_bool($eq(op.kind, 102/*TokenKind.IS*/))) {
+ if ($notnull_bool($eq(op.get$kind(), 102/*TokenKind.IS*/))) {
var isTrue = !$notnull_bool(this._maybeEat(19/*TokenKind.NOT*/));
var typeRef = this.type(0);
x = new IsExpression(isTrue, x, typeRef, this._makeSpan(x.span.start));
continue;
}
var y = this.infixExpression($assert_num($notnull_bool($eq(prec, 2)) ? prec : prec + 1));
- if ($notnull_bool($eq(op.kind, 33/*TokenKind.CONDITIONAL*/))) {
+ if ($notnull_bool($eq(op.get$kind(), 33/*TokenKind.CONDITIONAL*/))) {
this._eat(8/*TokenKind.COLON*/);
var z = this.infixExpression($assert_num(prec));
x = new ConditionalExpression(x, y, z, this._makeSpan(x.span.start));
@@ -18372,27 +18556,27 @@ lang_Parser.prototype.finishPostfixExpression = function(expr) {
switch (this._peek()) {
case 2/*TokenKind.LPAREN*/:
- return this.finishPostfixExpression(new CallExpression(expr, this.arguments(), this._makeSpan(expr.get$span().start)));
+ return this.finishPostfixExpression(new CallExpression(expr, this.arguments(), this._makeSpan($assert_num(expr.get$span().get$start()))));
case 4/*TokenKind.LBRACK*/:
this._eat(4/*TokenKind.LBRACK*/);
var index = this.expression();
this._eat(5/*TokenKind.RBRACK*/);
- return this.finishPostfixExpression(new IndexExpression(expr, index, this._makeSpan(expr.get$span().start)));
+ return this.finishPostfixExpression(new IndexExpression(expr, index, this._makeSpan($assert_num(expr.get$span().get$start()))));
case 14/*TokenKind.DOT*/:
this._eat(14/*TokenKind.DOT*/);
var name = this.identifier();
- var ret = new DotExpression(expr, name, this._makeSpan(expr.get$span().start));
+ var ret = new DotExpression(expr, name, this._makeSpan($assert_num(expr.get$span().get$start())));
return this.finishPostfixExpression(ret);
case 16/*TokenKind.INCR*/:
case 17/*TokenKind.DECR*/:
var tok = this._lang_next();
- return new PostfixExpression(expr, tok, this._makeSpan(expr.get$span().start));
+ return new PostfixExpression(expr, tok, this._makeSpan($assert_num(expr.get$span().get$start())));
case 9/*TokenKind.ARROW*/:
case 6/*TokenKind.LBRACE*/:
@@ -18404,7 +18588,7 @@ lang_Parser.prototype.finishPostfixExpression = function(expr) {
default:
if ($notnull_bool(this._peekIdentifier())) {
- return this.finishPostfixExpression(new DeclaredIdentifier(this._makeType(expr), this.identifier(), this._makeSpan(expr.get$span().start)));
+ return this.finishPostfixExpression(new DeclaredIdentifier(this._makeType(expr), this.identifier(), this._makeSpan($assert_num(expr.get$span().get$start()))));
}
else {
return expr;
@@ -18413,7 +18597,7 @@ lang_Parser.prototype.finishPostfixExpression = function(expr) {
}
}
lang_Parser.prototype._isBin = function(expr, kind) {
- return (expr instanceof BinaryExpression) && expr.op.kind == kind;
+ return $notnull_bool((expr instanceof BinaryExpression) && $eq(expr.get$op().get$kind(), kind));
}
lang_Parser.prototype._boolTypeRef = function(span) {
return new TypeReference(span, world.nonNullBool);
@@ -18492,17 +18676,17 @@ lang_Parser.prototype.primary = function() {
case 61/*TokenKind.HEX_INTEGER*/:
var t = this._lang_next();
- return new LiteralExpression(lang_Parser.parseHex(t.get$text().substring(2)), this._intTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
+ return new LiteralExpression(lang_Parser.parseHex($assert_String(t.get$text().substring$1(2))), this._intTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
case 60/*TokenKind.INTEGER*/:
var t = this._lang_next();
- return new LiteralExpression(Math.parseInt(t.get$text()), this._intTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
+ return new LiteralExpression(Math.parseInt($assert_String(t.get$text())), this._intTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
case 62/*TokenKind.DOUBLE*/:
var t = this._lang_next();
- return new LiteralExpression(Math.parseDouble(t.get$text()), this._doubleTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
+ return new LiteralExpression(Math.parseDouble($assert_String(t.get$text())), this._doubleTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
case 58/*TokenKind.STRING*/:
@@ -18532,6 +18716,7 @@ lang_Parser.prototype.primary = function() {
}
}
lang_Parser.prototype.stringInterpolation = function() {
+ var $0;
var start = this._peekToken.start;
var lits = [];
var startQuote = null, endQuote = null;
@@ -18551,22 +18736,22 @@ lang_Parser.prototype.stringInterpolation = function() {
else {
text = startQuote + text.substring$2(0, text.length - 1) + endQuote;
}
- lits.add$1(this.makeStringLiteral($assert_String(text), token.get$span()));
+ lits.add$1(this.makeStringLiteral($assert_String(text), (($0 = token.get$span()) && $0.is$SourceSpan())));
if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) {
lits.add$1(this.expression());
this._eat(7/*TokenKind.RBRACE*/);
}
else {
var id = this.identifier();
- lits.add$1(new VarExpression(id, id.get$span()));
+ lits.add$1(new VarExpression(id, (($0 = id.get$span()) && $0.is$SourceSpan())));
}
}
var tok = this._lang_next();
- if ($notnull_bool($ne(tok.kind, 58/*TokenKind.STRING*/))) {
+ if ($notnull_bool($ne(tok.get$kind(), 58/*TokenKind.STRING*/))) {
this._errorExpected('interpolated string');
}
var text = startQuote + tok.get$text();
- lits.add$1(this.makeStringLiteral($assert_String(text), tok.get$span()));
+ lits.add$1(this.makeStringLiteral($assert_String(text), (($0 = tok.get$span()) && $0.is$SourceSpan())));
var span = this._makeSpan(start);
return new LiteralExpression(lits, this._stringTypeRef((span && span.is$SourceSpan())), '\$\$\$', (span && span.is$SourceSpan()));
}
@@ -18574,8 +18759,9 @@ lang_Parser.prototype.makeStringLiteral = function(text, span) {
return new LiteralExpression(text, this._stringTypeRef(span), text, span);
}
lang_Parser.prototype.stringLiteralExpr = function() {
+ var $0;
var token = this._lang_next();
- return this.makeStringLiteral(token.get$text(), token.get$span());
+ return this.makeStringLiteral($assert_String(token.get$text()), (($0 = token.get$span()) && $0.is$SourceSpan()));
}
lang_Parser.prototype.maybeStringLiteral = function() {
var kind = this._peek();
@@ -18593,16 +18779,17 @@ lang_Parser.prototype.maybeStringLiteral = function() {
return null;
}
lang_Parser.prototype._parenOrLambda = function() {
+ var $0;
var start = this._peekToken.start;
var args = this.arguments();
if (!$notnull_bool(this._inInitializers) && ($notnull_bool(this._peekKind(9/*TokenKind.ARROW*/) || this._peekKind(6/*TokenKind.LBRACE*/)))) {
var body = this.functionBody(true);
var formals = this._makeFormals(args);
var func = new FunctionDefinition(null, null, null, formals, null, body, this._makeSpan(start));
- return new LambdaExpression(func, func.get$span());
+ return new LambdaExpression(func, (($0 = func.get$span()) && $0.is$SourceSpan()));
}
else {
- if (args.length == 1) {
+ if ($notnull_bool($eq(args.length, 1))) {
return new ParenExpression(args.$index(0).get$value(), this._makeSpan(start));
}
else {
@@ -18694,7 +18881,7 @@ lang_Parser.prototype.declaredIdentifier = function(includeOperators) {
if ($notnull_bool(this._peekIdentifier())) {
name = this.identifier();
}
- else if ((myType instanceof NameTypeReference) && myType.names == null) {
+ else if ($notnull_bool((myType instanceof NameTypeReference) && myType.get$names() == null)) {
name = this._typeAsIdentifier(myType);
myType = null;
}
@@ -18820,7 +19007,7 @@ lang_Parser.prototype.typeParameters = function() {
do {
var tp = this.typeParameter();
ret.add$1(tp);
- if ((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth == 0) {
+ if ($notnull_bool((tp.get$extendsType() instanceof GenericTypeReference) && $eq(tp.get$extendsType().get$depth(), 0))) {
closed = true;
break;
}
@@ -18858,8 +19045,8 @@ lang_Parser.prototype._finishTypeArguments = function(baseType, depth, types) {
do {
var myType = this.type(depth + 1);
types.add$1(myType);
- if ((myType instanceof GenericTypeReference) && myType.depth <= depth) {
- delta = depth - myType.depth;
+ if ((myType instanceof GenericTypeReference) && myType.get$depth() <= depth) {
+ delta = depth - $assert_num(myType.get$depth());
break;
}
}
@@ -18921,12 +19108,16 @@ lang_Parser.prototype.type = function(depth) {
return typeRef;
}
}
+lang_Parser.prototype.get$type = function() {
+ return lang_Parser.prototype.type.bind(this);
+}
lang_Parser.prototype.formalParameter = function(inOptionalBlock) {
+ var $0;
var start = this._peekToken.start;
var isThis = false;
var isRest = false;
var di = this.declaredIdentifier(false);
- var type = di.type;
+ var type = di.get$type();
var name = di.get$name();
var value = null;
if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
@@ -18938,7 +19129,7 @@ lang_Parser.prototype.formalParameter = function(inOptionalBlock) {
else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) {
var formals = this.formalParameterList();
var func = new FunctionDefinition(null, type, name, formals, null, null, this._makeSpan(start));
- type = new FunctionTypeReference(false, func, func.get$span());
+ type = new FunctionTypeReference(false, func, (($0 = func.get$span()) && $0.is$SourceSpan()));
}
if ($notnull_bool(inOptionalBlock && value == null)) {
value = new NullExpression(this._makeSpan(start));
@@ -18971,30 +19162,32 @@ lang_Parser.prototype.formalParameterList = function() {
return formals;
}
lang_Parser.prototype.identifier = function() {
+ var $0;
var tok = this._lang_next();
- if (!$notnull_bool(TokenKind.isIdentifier($assert_num(tok.kind)))) {
- this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$span());
+ if (!$notnull_bool(TokenKind.isIdentifier($assert_num(tok.get$kind())))) {
+ this._lang_error(('expected identifier, but found ' + tok + ''), (($0 = tok.get$span()) && $0.is$SourceSpan()));
}
- return new lang_Identifier(tok.get$text(), this._makeSpan(tok.start));
+ return new lang_Identifier(tok.get$text(), this._makeSpan($assert_num(tok.get$start())));
}
lang_Parser.prototype._makeFunction = function(expr, body) {
+ var $0;
var name, type;
if ((expr instanceof CallExpression)) {
- if ((expr.target instanceof VarExpression)) {
- name = expr.target.get$name();
+ if ((expr.get$target() instanceof VarExpression)) {
+ name = expr.get$target().get$name();
type = null;
}
- else if ((expr.target instanceof DeclaredIdentifier)) {
- name = expr.target.get$name();
- type = expr.target.type;
+ else if ((expr.get$target() instanceof DeclaredIdentifier)) {
+ name = expr.get$target().get$name();
+ type = expr.get$target().get$type();
}
else {
this._lang_error('bad function');
}
var formals = this._makeFormals(expr.get$arguments());
- var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body.get$span().end);
+ var span = new SourceSpan(expr.get$span().get$file(), expr.get$span().get$start(), body.get$span().get$end());
var func = new FunctionDefinition(null, type, name, formals, null, body, (span && span.is$SourceSpan()));
- return new LambdaExpression(func, func.get$span());
+ return new LambdaExpression(func, (($0 = func.get$span()) && $0.is$SourceSpan()));
}
else {
this._lang_error('expected function');
@@ -19003,14 +19196,14 @@ lang_Parser.prototype._makeFunction = function(expr, body) {
lang_Parser.prototype._makeFormal = function(expr) {
var $0;
if ((expr instanceof VarExpression)) {
- return new FormalNode(false, false, null, expr.get$name(), null, expr.get$span());
+ return new FormalNode(false, false, null, expr.get$name(), null, (($0 = expr.get$span()) && $0.is$SourceSpan()));
}
else if ((expr instanceof DeclaredIdentifier)) {
- return new FormalNode(false, false, expr.type, expr.get$name(), null, expr.get$span());
+ return new FormalNode(false, false, expr.get$type(), expr.get$name(), null, (($0 = expr.get$span()) && $0.is$SourceSpan()));
}
- else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.x instanceof DeclaredIdentifier)))) {
- var di = (($0 = expr.x) && $0.is$DeclaredIdentifier());
- return new FormalNode(false, false, di.type, di.name, expr.y, expr.get$span());
+ else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.get$x() instanceof DeclaredIdentifier)))) {
+ var di = (($0 = expr.get$x()) && $0.is$DeclaredIdentifier());
+ return new FormalNode(false, false, di.type, di.name, expr.get$y(), (($0 = expr.get$span()) && $0.is$SourceSpan()));
}
else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/))) {
return null;
@@ -19019,24 +19212,25 @@ lang_Parser.prototype._makeFormal = function(expr) {
return this._makeFormalsFromList(expr);
}
else {
- this._lang_error('expected formal', expr.get$span());
+ this._lang_error('expected formal', (($0 = expr.get$span()) && $0.is$SourceSpan()));
}
}
lang_Parser.prototype._makeFormalsFromList = function(expr) {
+ var $0;
if ($notnull_bool(expr.get$isConst())) {
- this._lang_error('expected formal, but found "const"', expr.get$span());
+ this._lang_error('expected formal, but found "const"', (($0 = expr.get$span()) && $0.is$SourceSpan()));
}
- else if ($notnull_bool($ne(expr.type, null))) {
- this._lang_error('expected formal, but found generic type arguments', expr.type.get$span());
+ else if ($notnull_bool($ne(expr.get$type(), null))) {
+ this._lang_error('expected formal, but found generic type arguments', (($0 = expr.get$type().get$span()) && $0.is$SourceSpan()));
}
- return this._makeFormalsFromExpressions(expr.values, false);
+ return this._makeFormalsFromExpressions(expr.get$values(), false);
}
lang_Parser.prototype._makeFormals = function(arguments) {
var expressions = [];
for (var i = 0;
- i < arguments.length; i++) {
+ i < $assert_num(arguments.length); i++) {
var arg = arguments.$index(i);
- if (arg.label != null) {
+ if ($notnull_bool($ne(arg.get$label(), null))) {
this._lang_error('expected formal, but found ":"');
}
expressions.add$1(arg.get$value());
@@ -19047,26 +19241,26 @@ lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO
var $0;
var formals = [];
for (var i = 0;
- i < expressions.length; i++) {
+ i < $assert_num(expressions.length); i++) {
var formal = this._makeFormal(expressions.$index(i));
if ($notnull_bool(formal == null)) {
- var baseType = this._makeType(expressions.$index(i).x);
- var typeParams = [this._makeType(expressions.$index(i).y)];
+ var baseType = this._makeType(expressions.$index(i).get$x());
+ var typeParams = [this._makeType(expressions.$index(i).get$y())];
i++;
- while (i < expressions.length) {
+ while (i < $assert_num(expressions.length)) {
var expr = expressions.$index(i++);
if ($notnull_bool(this._isBin(expr, 53/*TokenKind.GT*/))) {
- typeParams.add$1(this._makeType(expr.x));
- var type = new GenericTypeReference(baseType, typeParams, 0, this._makeSpan(baseType.get$span().start));
+ typeParams.add$1(this._makeType(expr.get$x()));
+ var type = new GenericTypeReference(baseType, typeParams, 0, this._makeSpan($assert_num(baseType.get$span().get$start())));
var name = null;
- if ((expr.y instanceof VarExpression)) {
- var ve = (($0 = expr.y) && $0.is$VarExpression());
+ if ((expr.get$y() instanceof VarExpression)) {
+ var ve = (($0 = expr.get$y()) && $0.is$VarExpression());
name = ve.name;
}
else {
- this._lang_error('expected formal', expr.get$span());
+ this._lang_error('expected formal', (($0 = expr.get$span()) && $0.is$SourceSpan()));
}
- formal = new FormalNode(false, false, type, name, null, this._makeSpan(expressions.$index(0).get$span().start));
+ formal = new FormalNode(false, false, type, name, null, this._makeSpan($assert_num(expressions.$index(0).get$span().get$start())));
break;
}
else {
@@ -19078,7 +19272,7 @@ lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO
else if (!!(formal && formal.is$List)) {
formals.addAll$1(formal);
if (!$notnull_bool(allowOptional)) {
- this._lang_error('unexpected nested optional formal', expressions.$index(i).get$span());
+ this._lang_error('unexpected nested optional formal', (($0 = expressions.$index(i).get$span()) && $0.is$SourceSpan()));
}
}
else {
@@ -19088,15 +19282,16 @@ lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO
return formals;
}
lang_Parser.prototype._makeDeclaredIdentifier = function(e) {
+ var $0;
if ((e instanceof VarExpression)) {
- return new DeclaredIdentifier(null, e.get$name(), e.get$span());
+ return new DeclaredIdentifier(null, e.get$name(), (($0 = e.get$span()) && $0.is$SourceSpan()));
}
else if ((e instanceof DeclaredIdentifier)) {
return e;
}
else {
this._lang_error('expected declared identifier');
- return new DeclaredIdentifier(null, null, e.get$span());
+ return new DeclaredIdentifier(null, null, (($0 = e.get$span()) && $0.is$SourceSpan()));
}
}
lang_Parser.prototype._makeLabel = function(expr) {
@@ -19169,6 +19364,8 @@ function TypeReference(span, type) {
}
$inherits(TypeReference, lang_Node);
TypeReference.prototype.is$TypeReference = function(){return this;};
+TypeReference.prototype.get$type = function() { return this.type; };
+TypeReference.prototype.set$type = function(value) { return this.type = value; };
TypeReference.prototype.visit = function(visitor) {
return visitor.visitTypeReference(this);
}
@@ -19216,6 +19413,8 @@ TypeDefinition.prototype.get$typeParameters = function() { return this.typeParam
TypeDefinition.prototype.set$typeParameters = function(value) { return this.typeParameters = value; };
TypeDefinition.prototype.get$nativeType = function() { return this.nativeType; };
TypeDefinition.prototype.set$nativeType = function(value) { return this.nativeType = value; };
+TypeDefinition.prototype.get$body = function() { return this.body; };
+TypeDefinition.prototype.set$body = function(value) { return this.body = value; };
TypeDefinition.prototype.visit = function(visitor) {
return visitor.visitTypeDefinition(this);
}
@@ -19230,6 +19429,8 @@ function FunctionTypeDefinition(func, typeParameters, span) {
// Initializers done
}
$inherits(FunctionTypeDefinition, Definition);
+FunctionTypeDefinition.prototype.get$func = function() { return this.func; };
+FunctionTypeDefinition.prototype.set$func = function(value) { return this.func = value; };
FunctionTypeDefinition.prototype.get$typeParameters = function() { return this.typeParameters; };
FunctionTypeDefinition.prototype.set$typeParameters = function(value) { return this.typeParameters = value; };
FunctionTypeDefinition.prototype.visit = function(visitor) {
@@ -19248,6 +19449,12 @@ function VariableDefinition(modifiers, type, names, values, span) {
// Initializers done
}
$inherits(VariableDefinition, Definition);
+VariableDefinition.prototype.get$type = function() { return this.type; };
+VariableDefinition.prototype.set$type = function(value) { return this.type = value; };
+VariableDefinition.prototype.get$names = function() { return this.names; };
+VariableDefinition.prototype.set$names = function(value) { return this.names = value; };
+VariableDefinition.prototype.get$values = function() { return this.values; };
+VariableDefinition.prototype.set$values = function(value) { return this.values = value; };
VariableDefinition.prototype.visit = function(visitor) {
return visitor.visitVariableDefinition(this);
}
@@ -19271,6 +19478,10 @@ FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
FunctionDefinition.prototype.set$returnType = function(value) { return this.returnType = value; };
FunctionDefinition.prototype.get$name = function() { return this.name; };
FunctionDefinition.prototype.set$name = function(value) { return this.name = value; };
+FunctionDefinition.prototype.get$initializers = function() { return this.initializers; };
+FunctionDefinition.prototype.set$initializers = function(value) { return this.initializers = value; };
+FunctionDefinition.prototype.get$body = function() { return this.body; };
+FunctionDefinition.prototype.set$body = function(value) { return this.body = value; };
FunctionDefinition.prototype.visit = function(visitor) {
return visitor.visitFunctionDefinition(this);
}
@@ -19327,6 +19538,8 @@ function BreakStatement(label, span) {
// Initializers done
}
$inherits(BreakStatement, lang_Statement);
+BreakStatement.prototype.get$label = function() { return this.label; };
+BreakStatement.prototype.set$label = function(value) { return this.label = value; };
BreakStatement.prototype.visit = function(visitor) {
return visitor.visitBreakStatement(this);
}
@@ -19340,6 +19553,8 @@ function ContinueStatement(label, span) {
// Initializers done
}
$inherits(ContinueStatement, lang_Statement);
+ContinueStatement.prototype.get$label = function() { return this.label; };
+ContinueStatement.prototype.set$label = function(value) { return this.label = value; };
ContinueStatement.prototype.visit = function(visitor) {
return visitor.visitContinueStatement(this);
}
@@ -19369,6 +19584,8 @@ function WhileStatement(test, body, span) {
// Initializers done
}
$inherits(WhileStatement, lang_Statement);
+WhileStatement.prototype.get$body = function() { return this.body; };
+WhileStatement.prototype.set$body = function(value) { return this.body = value; };
WhileStatement.prototype.visit = function(visitor) {
return visitor.visitWhileStatement(this);
}
@@ -19383,6 +19600,8 @@ function DoStatement(body, test, span) {
// Initializers done
}
$inherits(DoStatement, lang_Statement);
+DoStatement.prototype.get$body = function() { return this.body; };
+DoStatement.prototype.set$body = function(value) { return this.body = value; };
DoStatement.prototype.visit = function(visitor) {
return visitor.visitDoStatement(this);
}
@@ -19399,6 +19618,8 @@ function ForStatement(init, test, step, body, span) {
// Initializers done
}
$inherits(ForStatement, lang_Statement);
+ForStatement.prototype.get$body = function() { return this.body; };
+ForStatement.prototype.set$body = function(value) { return this.body = value; };
ForStatement.prototype.visit = function(visitor) {
return visitor.visitForStatement(this);
}
@@ -19414,6 +19635,8 @@ function ForInStatement(item, list, body, span) {
// Initializers done
}
$inherits(ForInStatement, lang_Statement);
+ForInStatement.prototype.get$body = function() { return this.body; };
+ForInStatement.prototype.set$body = function(value) { return this.body = value; };
ForInStatement.prototype.visit = function(visitor) {
return visitor.visitForInStatement(this);
}
@@ -19429,6 +19652,8 @@ function TryStatement(body, catches, finallyBlock, span) {
// Initializers done
}
$inherits(TryStatement, lang_Statement);
+TryStatement.prototype.get$body = function() { return this.body; };
+TryStatement.prototype.set$body = function(value) { return this.body = value; };
TryStatement.prototype.visit = function(visitor) {
return visitor.visitTryStatement(this);
}
@@ -19443,6 +19668,8 @@ function SwitchStatement(test, cases, span) {
// Initializers done
}
$inherits(SwitchStatement, lang_Statement);
+SwitchStatement.prototype.get$cases = function() { return this.cases; };
+SwitchStatement.prototype.set$cases = function(value) { return this.cases = value; };
SwitchStatement.prototype.visit = function(visitor) {
return visitor.visitSwitchStatement(this);
}
@@ -19457,6 +19684,8 @@ function BlockStatement(body, span) {
}
$inherits(BlockStatement, lang_Statement);
BlockStatement.prototype.is$BlockStatement = function(){return this;};
+BlockStatement.prototype.get$body = function() { return this.body; };
+BlockStatement.prototype.set$body = function(value) { return this.body = value; };
BlockStatement.prototype.visit = function(visitor) {
return visitor.visitBlockStatement(this);
}
@@ -19473,6 +19702,8 @@ function LabeledStatement(name, body, span) {
$inherits(LabeledStatement, lang_Statement);
LabeledStatement.prototype.get$name = function() { return this.name; };
LabeledStatement.prototype.set$name = function(value) { return this.name = value; };
+LabeledStatement.prototype.get$body = function() { return this.body; };
+LabeledStatement.prototype.set$body = function(value) { return this.body = value; };
LabeledStatement.prototype.visit = function(visitor) {
return visitor.visitLabeledStatement(this);
}
@@ -19486,6 +19717,8 @@ function lang_ExpressionStatement(body, span) {
// Initializers done
}
$inherits(lang_ExpressionStatement, lang_Statement);
+lang_ExpressionStatement.prototype.get$body = function() { return this.body; };
+lang_ExpressionStatement.prototype.set$body = function(value) { return this.body = value; };
lang_ExpressionStatement.prototype.visit = function(visitor) {
return visitor.visitExpressionStatement(this);
}
@@ -19523,6 +19756,8 @@ function NativeStatement(body, span) {
// Initializers done
}
$inherits(NativeStatement, lang_Statement);
+NativeStatement.prototype.get$body = function() { return this.body; };
+NativeStatement.prototype.set$body = function(value) { return this.body = value; };
NativeStatement.prototype.visit = function(visitor) {
return visitor.visitNativeStatement(this);
}
@@ -19537,6 +19772,8 @@ function LambdaExpression(func, span) {
}
$inherits(LambdaExpression, lang_Expression);
LambdaExpression.prototype.is$LambdaExpression = function(){return this;};
+LambdaExpression.prototype.get$func = function() { return this.func; };
+LambdaExpression.prototype.set$func = function(value) { return this.func = value; };
LambdaExpression.prototype.visit = function(visitor) {
return visitor.visitLambdaExpression(this);
}
@@ -19552,6 +19789,8 @@ function CallExpression(target, arguments, span) {
}
$inherits(CallExpression, lang_Expression);
CallExpression.prototype.is$CallExpression = function(){return this;};
+CallExpression.prototype.get$target = function() { return this.target; };
+CallExpression.prototype.set$target = function(value) { return this.target = value; };
CallExpression.prototype.get$arguments = function() { return this.arguments; };
CallExpression.prototype.set$arguments = function(value) { return this.arguments = value; };
CallExpression.prototype.visit = function(visitor) {
@@ -19569,6 +19808,8 @@ function IndexExpression(target, index, span) {
}
$inherits(IndexExpression, lang_Expression);
IndexExpression.prototype.is$IndexExpression = function(){return this;};
+IndexExpression.prototype.get$target = function() { return this.target; };
+IndexExpression.prototype.set$target = function(value) { return this.target = value; };
IndexExpression.prototype.visit = function(visitor) {
return visitor.visitIndexExpression(this);
}
@@ -19585,6 +19826,12 @@ function BinaryExpression(op, x, y, span) {
}
$inherits(BinaryExpression, lang_Expression);
BinaryExpression.prototype.is$BinaryExpression = function(){return this;};
+BinaryExpression.prototype.get$op = function() { return this.op; };
+BinaryExpression.prototype.set$op = function(value) { return this.op = value; };
+BinaryExpression.prototype.get$x = function() { return this.x; };
+BinaryExpression.prototype.set$x = function(value) { return this.x = value; };
+BinaryExpression.prototype.get$y = function() { return this.y; };
+BinaryExpression.prototype.set$y = function(value) { return this.y = value; };
BinaryExpression.prototype.visit = function(visitor) {
return visitor.visitBinaryExpression(this);
}
@@ -19599,6 +19846,10 @@ function UnaryExpression(op, self, span) {
// Initializers done
}
$inherits(UnaryExpression, lang_Expression);
+UnaryExpression.prototype.get$op = function() { return this.op; };
+UnaryExpression.prototype.set$op = function(value) { return this.op = value; };
+UnaryExpression.prototype.get$self = function() { return this.self; };
+UnaryExpression.prototype.set$self = function(value) { return this.self = value; };
UnaryExpression.prototype.visit = function(visitor) {
return visitor.visitUnaryExpression(this);
}
@@ -19614,6 +19865,10 @@ function PostfixExpression(body, op, span) {
}
$inherits(PostfixExpression, lang_Expression);
PostfixExpression.prototype.is$PostfixExpression = function(){return this;};
+PostfixExpression.prototype.get$body = function() { return this.body; };
+PostfixExpression.prototype.set$body = function(value) { return this.body = value; };
+PostfixExpression.prototype.get$op = function() { return this.op; };
+PostfixExpression.prototype.set$op = function(value) { return this.op = value; };
PostfixExpression.prototype.visit = function(visitor) {
return visitor.visitPostfixExpression$1(this);
}
@@ -19632,6 +19887,8 @@ function lang_NewExpression(isConst, type, name, arguments, span) {
$inherits(lang_NewExpression, lang_Expression);
lang_NewExpression.prototype.get$isConst = function() { return this.isConst; };
lang_NewExpression.prototype.set$isConst = function(value) { return this.isConst = value; };
+lang_NewExpression.prototype.get$type = function() { return this.type; };
+lang_NewExpression.prototype.set$type = function(value) { return this.type = value; };
lang_NewExpression.prototype.get$name = function() { return this.name; };
lang_NewExpression.prototype.set$name = function(value) { return this.name = value; };
lang_NewExpression.prototype.get$arguments = function() { return this.arguments; };
@@ -19653,6 +19910,10 @@ function ListExpression(isConst, type, values, span) {
$inherits(ListExpression, lang_Expression);
ListExpression.prototype.get$isConst = function() { return this.isConst; };
ListExpression.prototype.set$isConst = function(value) { return this.isConst = value; };
+ListExpression.prototype.get$type = function() { return this.type; };
+ListExpression.prototype.set$type = function(value) { return this.type = value; };
+ListExpression.prototype.get$values = function() { return this.values; };
+ListExpression.prototype.set$values = function(value) { return this.values = value; };
ListExpression.prototype.visit = function(visitor) {
return visitor.visitListExpression(this);
}
@@ -19670,6 +19931,8 @@ function MapExpression(isConst, type, items, span) {
$inherits(MapExpression, lang_Expression);
MapExpression.prototype.get$isConst = function() { return this.isConst; };
MapExpression.prototype.set$isConst = function(value) { return this.isConst = value; };
+MapExpression.prototype.get$type = function() { return this.type; };
+MapExpression.prototype.set$type = function(value) { return this.type = value; };
MapExpression.prototype.visit = function(visitor) {
return visitor.visitMapExpression(this);
}
@@ -19700,6 +19963,10 @@ function IsExpression(isTrue, x, type, span) {
// Initializers done
}
$inherits(IsExpression, lang_Expression);
+IsExpression.prototype.get$x = function() { return this.x; };
+IsExpression.prototype.set$x = function(value) { return this.x = value; };
+IsExpression.prototype.get$type = function() { return this.type; };
+IsExpression.prototype.set$type = function(value) { return this.type = value; };
IsExpression.prototype.visit = function(visitor) {
return visitor.visitIsExpression(this);
}
@@ -19713,6 +19980,8 @@ function ParenExpression(body, span) {
// Initializers done
}
$inherits(ParenExpression, lang_Expression);
+ParenExpression.prototype.get$body = function() { return this.body; };
+ParenExpression.prototype.set$body = function(value) { return this.body = value; };
ParenExpression.prototype.visit = function(visitor) {
return visitor.visitParenExpression(this);
}
@@ -19728,6 +19997,8 @@ function DotExpression(self, name, span) {
}
$inherits(DotExpression, lang_Expression);
DotExpression.prototype.is$DotExpression = function(){return this;};
+DotExpression.prototype.get$self = function() { return this.self; };
+DotExpression.prototype.set$self = function(value) { return this.self = value; };
DotExpression.prototype.get$name = function() { return this.name; };
DotExpression.prototype.set$name = function(value) { return this.name = value; };
DotExpression.prototype.visit = function(visitor) {
@@ -19799,6 +20070,8 @@ function LiteralExpression(value, type, text, span) {
$inherits(LiteralExpression, lang_Expression);
LiteralExpression.prototype.get$value = function() { return this.value; };
LiteralExpression.prototype.set$value = function(value) { return this.value = value; };
+LiteralExpression.prototype.get$type = function() { return this.type; };
+LiteralExpression.prototype.set$type = function(value) { return this.type = value; };
LiteralExpression.prototype.get$text = function() { return this.text; };
LiteralExpression.prototype.set$text = function(value) { return this.text = value; };
LiteralExpression.prototype.visit = function(visitor) {
@@ -19817,8 +20090,12 @@ function NameTypeReference(isFinal, name, names, span) {
}
$inherits(NameTypeReference, TypeReference);
NameTypeReference.prototype.is$NameTypeReference = function(){return this;};
+NameTypeReference.prototype.get$isFinal = function() { return this.isFinal; };
+NameTypeReference.prototype.set$isFinal = function(value) { return this.isFinal = value; };
NameTypeReference.prototype.get$name = function() { return this.name; };
NameTypeReference.prototype.set$name = function(value) { return this.name = value; };
+NameTypeReference.prototype.get$names = function() { return this.names; };
+NameTypeReference.prototype.set$names = function(value) { return this.names = value; };
NameTypeReference.prototype.visit = function(visitor) {
return visitor.visitNameTypeReference(this);
}
@@ -19835,6 +20112,8 @@ function GenericTypeReference(baseType, typeArguments, depth, span) {
}
$inherits(GenericTypeReference, TypeReference);
GenericTypeReference.prototype.is$GenericTypeReference = function(){return this;};
+GenericTypeReference.prototype.get$depth = function() { return this.depth; };
+GenericTypeReference.prototype.set$depth = function(value) { return this.depth = value; };
GenericTypeReference.prototype.visit = function(visitor) {
return visitor.visitGenericTypeReference(this);
}
@@ -19850,6 +20129,10 @@ function FunctionTypeReference(isFinal, func, span) {
}
$inherits(FunctionTypeReference, TypeReference);
FunctionTypeReference.prototype.is$FunctionTypeReference = function(){return this;};
+FunctionTypeReference.prototype.get$isFinal = function() { return this.isFinal; };
+FunctionTypeReference.prototype.set$isFinal = function(value) { return this.isFinal = value; };
+FunctionTypeReference.prototype.get$func = function() { return this.func; };
+FunctionTypeReference.prototype.set$func = function(value) { return this.func = value; };
FunctionTypeReference.prototype.visit = function(visitor) {
return visitor.visitFunctionTypeReference(this);
}
@@ -19865,6 +20148,8 @@ function ArgumentNode(label, value, span) {
}
$inherits(ArgumentNode, lang_Node);
ArgumentNode.prototype.is$ArgumentNode = function(){return this;};
+ArgumentNode.prototype.get$label = function() { return this.label; };
+ArgumentNode.prototype.set$label = function(value) { return this.label = value; };
ArgumentNode.prototype.get$value = function() { return this.value; };
ArgumentNode.prototype.set$value = function(value) { return this.value = value; };
ArgumentNode.prototype.visit = function(visitor) {
@@ -19884,6 +20169,8 @@ function FormalNode(isThis, isRest, type, name, value, span) {
// Initializers done
}
$inherits(FormalNode, lang_Node);
+FormalNode.prototype.get$type = function() { return this.type; };
+FormalNode.prototype.set$type = function(value) { return this.type = value; };
FormalNode.prototype.get$name = function() { return this.name; };
FormalNode.prototype.set$name = function(value) { return this.name = value; };
FormalNode.prototype.get$value = function() { return this.value; };
@@ -19905,6 +20192,10 @@ function CatchNode(exception, trace, body, span) {
$inherits(CatchNode, lang_Node);
CatchNode.prototype.get$exception = function() { return this.exception; };
CatchNode.prototype.set$exception = function(value) { return this.exception = value; };
+CatchNode.prototype.get$trace = function() { return this.trace; };
+CatchNode.prototype.set$trace = function(value) { return this.trace = value; };
+CatchNode.prototype.get$body = function() { return this.body; };
+CatchNode.prototype.set$body = function(value) { return this.body = value; };
CatchNode.prototype.visit = function(visitor) {
return visitor.visitCatchNode(this);
}
@@ -19920,6 +20211,12 @@ function CaseNode(label, cases, statements, span) {
// Initializers done
}
$inherits(CaseNode, lang_Node);
+CaseNode.prototype.get$label = function() { return this.label; };
+CaseNode.prototype.set$label = function(value) { return this.label = value; };
+CaseNode.prototype.get$cases = function() { return this.cases; };
+CaseNode.prototype.set$cases = function(value) { return this.cases = value; };
+CaseNode.prototype.get$statements = function() { return this.statements; };
+CaseNode.prototype.set$statements = function(value) { return this.statements = value; };
CaseNode.prototype.visit = function(visitor) {
return visitor.visitCaseNode(this);
}
@@ -19936,6 +20233,8 @@ function TypeParameter(name, extendsType, span) {
$inherits(TypeParameter, lang_Node);
TypeParameter.prototype.get$name = function() { return this.name; };
TypeParameter.prototype.set$name = function(value) { return this.name = value; };
+TypeParameter.prototype.get$extendsType = function() { return this.extendsType; };
+TypeParameter.prototype.set$extendsType = function(value) { return this.extendsType = value; };
TypeParameter.prototype.visit = function(visitor) {
return visitor.visitTypeParameter(this);
}
@@ -19966,6 +20265,8 @@ function DeclaredIdentifier(type, name, span) {
}
$inherits(DeclaredIdentifier, lang_Expression);
DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;};
+DeclaredIdentifier.prototype.get$type = function() { return this.type; };
+DeclaredIdentifier.prototype.set$type = function(value) { return this.type = value; };
DeclaredIdentifier.prototype.get$name = function() { return this.name; };
DeclaredIdentifier.prototype.set$name = function(value) { return this.name = value; };
DeclaredIdentifier.prototype.visit = function(visitor) {
@@ -19983,6 +20284,10 @@ function lang_Type(name) {
lang_Type.prototype.is$lang_Type = function(){return this;};
lang_Type.prototype.is$Named = function(){return this;};
lang_Type.prototype.get$name = function() { return this.name; };
+lang_Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; };
+lang_Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckCode = value; };
+lang_Type.prototype.get$varStubs = function() { return this.varStubs; };
+lang_Type.prototype.set$varStubs = function(value) { return this.varStubs = value; };
lang_Type.prototype.markUsed = function() {
}
@@ -20148,7 +20453,7 @@ lang_Type.prototype.isSubtypeOf = function(other) {
if ($notnull_bool($ne(call, null) && $ne(otherCall, null))) {
return lang_Type._isFunctionSubtypeOf((call && call.is$MethodMember()), (otherCall && otherCall.is$MethodMember()));
}
- if ($notnull_bool($notnull_bool($eq(this.get$genericType(), other.get$genericType()) && $ne(this.get$typeArgsInOrder(), null)) && $ne(other.get$typeArgsInOrder(), null)) && this.get$typeArgsInOrder().length == other.get$typeArgsInOrder().length) {
+ if ($notnull_bool($notnull_bool($notnull_bool($eq(this.get$genericType(), other.get$genericType()) && $ne(this.get$typeArgsInOrder(), null)) && $ne(other.get$typeArgsInOrder(), null)) && $eq(this.get$typeArgsInOrder().length, other.get$typeArgsInOrder().length))) {
var t = this.get$typeArgsInOrder().iterator$0();
var s = other.get$typeArgsInOrder().iterator$0();
while ($notnull_bool(t.hasNext$0())) {
@@ -20173,14 +20478,14 @@ lang_Type._isFunctionSubtypeOf = function(t, s) {
}
var tp = t.parameters;
var sp = s.parameters;
- if (tp.length < sp.length) return false;
+ if (tp.length < $assert_num(sp.length)) return false;
for (var i = 0;
- i < sp.length; i++) {
- if ($ne(tp.$index(i).get$isOptional(), sp.$index(i).get$isOptional())) return false;
+ i < $assert_num(sp.length); i++) {
+ if ($notnull_bool($ne(tp.$index(i).get$isOptional(), sp.$index(i).get$isOptional()))) return false;
if ($notnull_bool(tp.$index(i).get$isOptional() && $ne(tp.$index(i).get$name(), sp.$index(i).get$name()))) return false;
- if (!$notnull_bool(tp.$index(i).type.isAssignable$1(sp.$index(i).type))) return false;
+ if (!$notnull_bool(tp.$index(i).get$type().isAssignable$1(sp.$index(i).get$type()))) return false;
}
- if (tp.length > sp.length && !$notnull_bool(tp.$index(sp.length).get$isOptional())) return false;
+ if (tp.length > $assert_num(sp.length) && !$notnull_bool(tp.$index(sp.length).get$isOptional())) return false;
return true;
}
lang_Type.prototype.addDirectSubtype$1 = function($0) {
@@ -20227,6 +20532,8 @@ function ParameterType(name, typeParameter) {
}
$inherits(ParameterType, lang_Type);
ParameterType.prototype.is$ParameterType = function(){return this;};
+ParameterType.prototype.get$extendsType = function() { return this.extendsType; };
+ParameterType.prototype.set$extendsType = function(value) { return this.extendsType = value; };
ParameterType.prototype.get$isClass = function() {
return false;
}
@@ -20300,6 +20607,7 @@ function NonNullableType(type) {
// Initializers done
}
$inherits(NonNullableType, lang_Type);
+NonNullableType.prototype.get$type = function() { return this.type; };
NonNullableType.prototype.get$isNullable = function() {
return false;
}
@@ -20458,10 +20766,10 @@ ConcreteType.prototype.get$span = function() {
return this.genericType.get$span();
}
ConcreteType.prototype.get$hasTypeParams = function() {
- return this.typeArguments.getValues().some$1((function (e) {
+ return $assert_bool(this.typeArguments.getValues().some$1((function (e) {
return (e instanceof ParameterType);
})
- );
+ ));
}
ConcreteType.prototype.get$members = function() { return this.members; };
ConcreteType.prototype.set$members = function(value) { return this.members = value; };
@@ -20505,7 +20813,7 @@ ConcreteType.prototype.getCallMethod = function() {
ConcreteType.prototype.getAllMembers = function() {
var result = this.genericType.getAllMembers();
var $list = result.getKeys$0();
- for (var $i = result.getKeys$0().iterator(); $i.hasNext$0(); ) {
+ for (var $i = result.getKeys$0().iterator$0(); $i.hasNext$0(); ) {
var memberName = $i.next$0();
var myMember = this.members.$index(memberName);
if ($notnull_bool($ne(myMember, null))) {
@@ -20530,9 +20838,9 @@ ConcreteType.prototype.getConstructor = function(constructorName) {
if ($notnull_bool($ne(ret, null))) return ret;
var genericMember = this.genericType.getConstructor(constructorName);
if ($notnull_bool(genericMember == null)) return null;
- if ($ne(genericMember.declaringType, this.genericType)) {
- if (!$notnull_bool(genericMember.declaringType.get$isGeneric())) return genericMember;
- var newDeclaringType = genericMember.declaringType.getOrMakeConcreteType(this.typeArgsInOrder);
+ if ($notnull_bool($ne(genericMember.get$declaringType(), this.genericType))) {
+ if (!$notnull_bool(genericMember.get$declaringType().get$isGeneric())) return genericMember;
+ var newDeclaringType = genericMember.get$declaringType().getOrMakeConcreteType$1(this.typeArgsInOrder);
var factory = newDeclaringType.getFactory$2(this.genericType, constructorName);
if (factory != null) return factory;
return newDeclaringType.getConstructor$1(constructorName);
@@ -20737,13 +21045,14 @@ DefinedType.prototype.genMethod = function(method) {
}
}
DefinedType.prototype._resolveInterfaces = function(types) {
+ var $0;
if (types == null) return [];
var interfaces = [];
for (var $i = 0;$i < types.length; $i++) {
var type = types.$index($i);
var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true);
if ($notnull_bool(resolvedInterface.get$isClosed() && !($notnull_bool(this.library.get$isCore() || this.library.get$isCoreImpl())))) {
- world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', type.get$span());
+ world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', (($0 = type.get$span()) && $0.is$SourceSpan()));
}
resolvedInterface.addDirectSubtype$1(this);
interfaces.add$1(resolvedInterface);
@@ -20816,7 +21125,7 @@ DefinedType.prototype.resolve = function() {
if ($notnull_bool(this.isClass)) {
if (typeDef.extendsTypes != null && typeDef.extendsTypes.length > 0) {
if (typeDef.extendsTypes.length > 1) {
- world.error('more than one base class', typeDef.extendsTypes.$index(1).get$span());
+ world.error('more than one base class', (($0 = typeDef.extendsTypes.$index(1).get$span()) && $0.is$SourceSpan()));
}
var extendsTypeRef = typeDef.extendsTypes.$index(0);
if ((extendsTypeRef instanceof GenericTypeReference)) {
@@ -20825,11 +21134,11 @@ DefinedType.prototype.resolve = function() {
}
this.set$parent(this.resolveType((extendsTypeRef && extendsTypeRef.is$TypeReference()), true));
if (!$notnull_bool(this.get$parent().get$isClass())) {
- world.error('class may not extend an interface - use implements', typeDef.extendsTypes.$index(0).get$span());
+ world.error('class may not extend an interface - use implements', (($0 = typeDef.extendsTypes.$index(0).get$span()) && $0.is$SourceSpan()));
}
this.get$parent().addDirectSubtype(this);
if ($notnull_bool(this._cycleInClassExtends())) {
- world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), extendsTypeRef.get$span());
+ world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), (($0 = extendsTypeRef.get$span()) && $0.is$SourceSpan()));
}
}
else {
@@ -20845,12 +21154,12 @@ DefinedType.prototype.resolve = function() {
}
else {
if (typeDef.implementsTypes != null && typeDef.implementsTypes.length > 0) {
- world.error('implements not allowed on interfaces (use extends)', typeDef.implementsTypes.$index(0).get$span());
+ world.error('implements not allowed on interfaces (use extends)', (($0 = typeDef.implementsTypes.$index(0).get$span()) && $0.is$SourceSpan()));
}
this.interfaces = this._resolveInterfaces(typeDef.extendsTypes);
var res = this._cycleInInterfaceExtends();
if (res >= 0) {
- world.error(('interface "' + this.name + '" has a cycle in its inheritance chain'), typeDef.extendsTypes.$index(res).get$span());
+ world.error(('interface "' + this.name + '" has a cycle in its inheritance chain'), (($0 = typeDef.extendsTypes.$index(res).get$span()) && $0.is$SourceSpan()));
}
if (typeDef.factoryType != null) {
this.factory_ = this.resolveType(typeDef.factoryType, true);
@@ -20897,12 +21206,12 @@ DefinedType.prototype.addMethod = function(methodName, definition) {
this.constructors.$setindex(method.get$constructorName(), method);
return;
}
- if ($notnull_bool(definition.modifiers != null && definition.modifiers.length == 1 && $eq(definition.modifiers.$index(0).kind, 75/*TokenKind.FACTORY*/))) {
- if (this.factories.getFactory(method.get$constructorName(), $assert_String(method.get$name())) != null) {
+ if ($notnull_bool(definition.modifiers != null && definition.modifiers.length == 1 && $eq(definition.modifiers.$index(0).get$kind(), 75/*TokenKind.FACTORY*/))) {
+ if (this.factories.getFactory($assert_String(method.get$constructorName()), $assert_String(method.get$name())) != null) {
world.error(('duplicate factory definition of "' + method.get$name() + '"'), definition.span);
return;
}
- this.factories.addFactory(method.get$constructorName(), $assert_String(method.get$name()), (method && method.is$Member()));
+ this.factories.addFactory($assert_String(method.get$constructorName()), $assert_String(method.get$name()), (method && method.is$Member()));
return;
}
if (methodName.startsWith('get\$') || methodName.startsWith('set\$')) {
@@ -20917,16 +21226,16 @@ DefinedType.prototype.addMethod = function(methodName, definition) {
return;
}
if (methodName[0] == 'g') {
- if (prop.getter != null) {
+ if ($notnull_bool($ne(prop.get$getter(), null))) {
world.error(('duplicate getter definition for "' + propName + '"'), definition.span);
}
- prop.getter = (method && method.is$MethodMember());
+ prop.set$getter(method);
}
else {
- if (prop.setter != null) {
+ if ($notnull_bool($ne(prop.get$setter(), null))) {
world.error(('duplicate setter definition for "' + propName + '"'), definition.span);
}
- prop.setter = (method && method.is$MethodMember());
+ prop.set$setter(method);
}
return;
}
@@ -20951,7 +21260,7 @@ DefinedType.prototype.addField = function(definition) {
var field = new FieldMember($assert_String(name), this, definition, value);
this.members.$setindex(name, field);
if ($notnull_bool(this.isNativeType)) {
- field.isNative = true;
+ field.set$isNative(true);
}
}
}
@@ -21012,7 +21321,7 @@ DefinedType.prototype.getMember = function(memberName) {
if ($notnull_bool(this.get$isTop())) {
var libType = this.library.findTypeByName(memberName);
if ($notnull_bool($ne(libType, null))) {
- return libType.get$typeMember();
+ return (($0 = libType.get$typeMember()) && $0.is$Member());
}
}
return this.getMemberInParents(memberName);
@@ -21154,14 +21463,14 @@ DefinedType.prototype.resolveType = function(node, typeErrors) {
var typeArgs = [];
for (var i = 0;
i < typeRef.typeArguments.length; i++) {
- var extendsType = baseType.get$typeParameters().$index(i).extendsType;
+ var extendsType = baseType.get$typeParameters().$index(i).get$extendsType();
var typeArg = this.resolveType((($0 = typeRef.typeArguments.$index(i)) && $0.is$TypeReference()), typeErrors);
typeArgs.add$1(typeArg);
if ($notnull_bool($ne(extendsType, null) && !(typeArg instanceof ParameterType))) {
typeArg.ensureSubtypeOf$3(extendsType, typeRef.typeArguments.$index(i).get$span(), typeErrors);
}
}
- typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs);
+ typeRef.type = (($0 = baseType.getOrMakeConcreteType$1(typeArgs)) && $0.is$lang_Type());
}
else if ((node instanceof FunctionTypeReference)) {
var typeRef = (node && node.is$FunctionTypeReference());
@@ -21266,6 +21575,7 @@ FixedCollection.prototype.isEmpty = function() {
return this.length == 0;
}
FixedCollection.prototype.filter$1 = FixedCollection.prototype.filter;
+FixedCollection.prototype.forEach$1 = FixedCollection.prototype.forEach;
FixedCollection.prototype.isEmpty$0 = function() {
return this.isEmpty();
};
@@ -21327,8 +21637,18 @@ function Value(type, code, span, needsTemp) {
if (this.type == null) world.internalError('type passed as null', this.span);
}
Value.prototype.is$Value = function(){return this;};
+Value.prototype.get$type = function() { return this.type; };
+Value.prototype.set$type = function(value) { return this.type = value; };
+Value.prototype.get$code = function() { return this.code; };
+Value.prototype.set$code = function(value) { return this.code = value; };
Value.prototype.get$span = function() { return this.span; };
Value.prototype.set$span = function(value) { return this.span = value; };
+Value.prototype.get$isSuper = function() { return this.isSuper; };
+Value.prototype.set$isSuper = function(value) { return this.isSuper = value; };
+Value.prototype.get$isType = function() { return this.isType; };
+Value.prototype.set$isType = function(value) { return this.isType = value; };
+Value.prototype.get$needsTemp = function() { return this.needsTemp; };
+Value.prototype.set$needsTemp = function(value) { return this.needsTemp = value; };
Value.prototype.get$_typeIsVarOrParameterType = function() {
return $notnull_bool(this.type.get$isVar() || (this.type instanceof ParameterType));
}
@@ -21339,9 +21659,10 @@ Value.prototype.get$canonicalCode = function() {
return null;
}
Value.prototype.get_ = function(context, name, node) {
+ var $0;
var member = this._resolveMember(context, name, node, false);
if ($notnull_bool($ne(member, null))) {
- return member._get$3(context, node, this);
+ return (($0 = member._get$3(context, node, this)) && $0.is$Value());
}
else {
return this.invokeNoSuchMethod(context, ('get:' + name + ''), node);
@@ -21357,13 +21678,14 @@ Value.prototype.set_ = function(context, name, node, value, isDynamic) {
}
}
Value.prototype.invoke = function(context, name, node, args, isDynamic) {
+ var $0;
if ($notnull_bool(this.get$_typeIsVarOrParameterType() && name == '\$ne')) {
if (args.values.length != 1) {
world.warning('wrong number of arguments for !=', node.span);
}
var eq = this.invoke(context, '\$eq', node, args, isDynamic);
world.gen.corejs.useOperator('\$ne');
- return new Value(eq.type, ('\$ne(' + this.code + ', ' + args.values.$index(0).code + ')'), node.span, true);
+ return new Value(eq.get$type(), ('\$ne(' + this.code + ', ' + args.values.$index(0).get$code() + ')'), node.span, true);
}
if (name == '\$call') {
if ($notnull_bool(this.isType)) {
@@ -21378,7 +21700,7 @@ Value.prototype.invoke = function(context, name, node, args, isDynamic) {
return this.invokeNoSuchMethod(context, name, node, args);
}
else {
- return member.invoke$5(context, node, this, args, isDynamic);
+ return (($0 = member.invoke$5(context, node, this, args, isDynamic)) && $0.is$Value());
}
}
Value.prototype.canInvoke = function(context, name, args) {
@@ -21394,7 +21716,7 @@ Value.prototype.canInvoke = function(context, name, args) {
Value.prototype._hasOverriddenNoSuchMethod = function() {
if ($notnull_bool(this.isSuper)) {
var m = this.type.getMember('noSuchMethod');
- return $notnull_bool($ne(m, null) && !$notnull_bool(m.declaringType.get$isObject()));
+ return $notnull_bool($ne(m, null) && !$notnull_bool(m.get$declaringType().get$isObject()));
}
else {
return this.type.resolveMember('noSuchMethod').members.length > 1;
@@ -21449,9 +21771,9 @@ Value.prototype._varCall = function(context, args) {
Value.prototype.needsConversion = function(toType) {
var callMethod = toType.getCallMethod();
if ($notnull_bool($ne(callMethod, null))) {
- var arity = callMethod.get$parameters().length;
+ var arity = $assert_num(callMethod.get$parameters().length);
var myCall = this.type.getCallMethod();
- if ($notnull_bool(myCall == null || myCall.get$parameters().length != arity)) {
+ if ($notnull_bool(myCall == null || $ne(myCall.get$parameters().length, arity))) {
return true;
}
}
@@ -21473,9 +21795,9 @@ Value.prototype.convertTo = function(context, toType, node, isDynamic) {
if ($notnull_bool(checked && !$notnull_bool(toType.isAssignable(this.type)))) {
this.convertWarning(toType, node);
}
- var arity = callMethod.get$parameters().length;
+ var arity = $assert_num(callMethod.get$parameters().length);
var myCall = this.type.getCallMethod();
- if ($notnull_bool(myCall == null || myCall.get$parameters().length != arity)) {
+ if ($notnull_bool(myCall == null || $ne(myCall.get$parameters().length, arity))) {
var stub = world.functionType.getCallStub(Arguments.Arguments$bare$factory(arity));
var val = new Value(toType, ('to\$' + stub.name + '(' + this.code + ')'), node.span, true);
return (($0 = $notnull_bool(this._isDomCallback(toType) && !$notnull_bool(this._isDomCallback(this.type))) ? val._wrapDomCallback(toType, arity) : val) && $0.is$Value());
@@ -21503,7 +21825,7 @@ Value.prototype.convertTo = function(context, toType, node, isDynamic) {
}
}
Value.prototype._isDomCallback = function(toType) {
- return ((toType.get$definition() instanceof FunctionTypeDefinition) && $eq(toType.get$library(), world.get$dom()));
+ return ($notnull_bool((toType.get$definition() instanceof FunctionTypeDefinition) && $eq(toType.get$library(), world.get$dom())));
}
Value.prototype._wrapDomCallback = function(toType, arity) {
return new Value(toType, ('\$wrap_call\$' + arity + '(' + this.code + ')'), this.span, true);
@@ -21538,7 +21860,7 @@ Value.prototype._typeAssert = function(context, toType, node) {
toType.isTested = true;
var temp = context.getTemp(this);
check = ('(' + context.assignTemp((temp && temp.is$Value()), this).code + ' &&');
- check = check + (' ' + temp.code + '.is\$' + toType.get$jsname() + '())');
+ check = check + (' ' + temp.get$code() + '.is\$' + toType.get$jsname() + '())');
if ($ne(this, temp)) context.freeTemp((temp && temp.is$Value()));
}
return new Value(toType, check, this.span, true);
@@ -21569,7 +21891,7 @@ Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck)
toType.isTested = true;
var temp = context.getTemp(this);
testCode = ('(' + context.assignTemp((temp && temp.is$Value()), this).code + ' &&');
- testCode = testCode + (' ' + temp.code + '.is\$' + toType.get$jsname() + ')');
+ testCode = testCode + (' ' + temp.get$code() + '.is\$' + toType.get$jsname() + ')');
if ($notnull_bool(isTrue)) {
testCode = '!!' + testCode;
}
@@ -21584,17 +21906,18 @@ Value.prototype.convertWarning = function(toType, node) {
world.warning(('type "' + this.type.name + '" is not assignable to "' + toType.name + '"'), node.span);
}
Value.prototype.invokeNoSuchMethod = function(context, name, node, args) {
+ var $0;
var pos = '';
if (args != null) {
var argsCode = [];
for (var i = 0;
i < args.get$length(); i++) {
- argsCode.add$1(args.values.$index(i).code);
+ argsCode.add$1(args.values.$index(i).get$code());
}
pos = Strings.join((argsCode && argsCode.is$List$String()), ", ");
}
var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), node.span, true), new Value(world.listType, ('[' + pos + ']'), node.span, true)];
- return this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(context, node, this, new Arguments(null, noSuchArgs));
+ return (($0 = this._resolveMember(context, 'noSuchMethod', node, false).invoke$4(context, node, this, new Arguments(null, noSuchArgs))) && $0.is$Value());
}
Value.prototype.invokeSpecial = function(name, args, returnType) {
$assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 449, 12);
@@ -21677,6 +22000,8 @@ $inherits(ConstListValue, EvaluatedValue);
ConstListValue.ConstListValue$factory = function(type, values, actualValue, canonicalCode, span) {
return new ConstListValue._internal$ctor(type, values, actualValue, canonicalCode, span, EvaluatedValue.codeWithComments(canonicalCode, span));
}
+ConstListValue.prototype.get$values = function() { return this.values; };
+ConstListValue.prototype.set$values = function(value) { return this.values = value; };
// ********** Code for ConstMapValue **************
function ConstMapValue() {}
ConstMapValue._internal$ctor = function(type, values, actualValue, canonicalCode, span, code) {
@@ -21694,6 +22019,8 @@ ConstMapValue.ConstMapValue$factory = function(type, keyValuePairs, actualValue,
}
return new ConstMapValue._internal$ctor(type, values, actualValue, canonicalCode, span, EvaluatedValue.codeWithComments(canonicalCode, span));
}
+ConstMapValue.prototype.get$values = function() { return this.values; };
+ConstMapValue.prototype.set$values = function(value) { return this.values = value; };
// ********** Code for ConstObjectValue **************
function ConstObjectValue() {}
ConstObjectValue._internal$ctor = function(type, fields, actualValue, canonicalCode, span, code) {
@@ -21717,6 +22044,8 @@ ConstObjectValue.ConstObjectValue$factory = function(type, fields, canonicalCode
var actualValue = ('const ' + type.get$jsname() + ' [') + Strings.join(fieldValues, ',') + ']';
return new ConstObjectValue._internal$ctor(type, fields, actualValue, canonicalCode, span, EvaluatedValue.codeWithComments(canonicalCode, span));
}
+ConstObjectValue.prototype.get$fields = function() { return this.fields; };
+ConstObjectValue.prototype.set$fields = function(value) { return this.fields = value; };
// ********** Code for GlobalValue **************
function GlobalValue(type, code, isConst, field, name, exp, canonicalCode, span, dependencies) {
this.field = field;
@@ -21732,8 +22061,8 @@ GlobalValue.prototype.is$GlobalValue = function(){return this;};
GlobalValue.prototype.is$Comparable = function(){return this;};
GlobalValue.GlobalValue$fromStatic$factory = function(field, exp, dependencies) {
var code = ($notnull_bool(exp.get$isConst()) ? exp.get$canonicalCode() : exp.code);
- var codeWithComment = ('' + code + '/*' + field.declaringType.name + '.' + field.get$name() + '*/');
- return new GlobalValue(exp.type, $assert_String(codeWithComment), field.isFinal, field, null, exp, code, exp.span, dependencies.filter$1((function (d) {
+ var codeWithComment = ('' + code + '/*' + field.get$declaringType().get$name() + '.' + field.get$name() + '*/');
+ return new GlobalValue(exp.type, $assert_String(codeWithComment), $assert_bool(field.get$isFinal()), field, null, exp, code, exp.span, dependencies.filter$1((function (d) {
return (d instanceof GlobalValue);
})
));
@@ -21746,8 +22075,12 @@ GlobalValue.GlobalValue$fromConst$factory = function(uniqueId, exp, dependencies
})
));
}
+GlobalValue.prototype.get$field = function() { return this.field; };
+GlobalValue.prototype.set$field = function(value) { return this.field = value; };
GlobalValue.prototype.get$name = function() { return this.name; };
GlobalValue.prototype.set$name = function(value) { return this.name = value; };
+GlobalValue.prototype.get$exp = function() { return this.exp; };
+GlobalValue.prototype.set$exp = function(value) { return this.exp = value; };
GlobalValue.prototype.get$canonicalCode = function() { return this.canonicalCode; };
GlobalValue.prototype.set$canonicalCode = function(value) { return this.canonicalCode = value; };
GlobalValue.prototype.get$isConst = function() {
@@ -21855,6 +22188,8 @@ World.prototype.get$dom = function() {
var $0;
return (($0 = this.libraries.$index('dart:dom')) && $0.is$Library());
}
+World.prototype.get$dynamicType = function() { return this.dynamicType; };
+World.prototype.set$dynamicType = function(value) { return this.dynamicType = value; };
World.prototype.get$functionType = function() { return this.functionType; };
World.prototype.set$functionType = function(value) { return this.functionType = value; };
World.prototype.init = function() {
@@ -21894,12 +22229,13 @@ World.prototype._addMember = function(member) {
}
}
World.prototype._addTopName = function(named) {
+ var $0;
var existing = this._topNames.$index(named.get$name());
if ($notnull_bool($ne(existing, null))) {
- this.info(('mangling matching top level name "' + named.get$name() + '" in ') + ('both "' + named.get$library().name + '" and "' + existing.get$library().name + '"'));
+ this.info(('mangling matching top level name "' + named.get$name() + '" in ') + ('both "' + named.get$library().name + '" and "' + existing.get$library().get$name() + '"'));
if ($notnull_bool(named.get$isNative())) {
if ($notnull_bool(existing.get$isNative())) {
- world.internalError(('conflicting native names "' + named.get$name() + '" ') + ('(already defined in ' + existing.get$span().get$locationText() + ')'), named.get$span());
+ world.internalError(('conflicting native names "' + named.get$name() + '" ') + ('(already defined in ' + existing.get$span().get$locationText() + ')'), (($0 = named.get$span()) && $0.is$SourceSpan()));
}
else {
this._topNames.$setindex(named.get$name(), named);
@@ -21908,7 +22244,7 @@ World.prototype._addTopName = function(named) {
}
else if ($notnull_bool(named.get$library().get$isCore())) {
if ($notnull_bool(existing.get$library().get$isCore())) {
- world.internalError(('conflicting top-level names in core "' + named.get$name() + '" ') + ('(previously defined in ' + existing.get$span().get$locationText() + ')'), named.get$span());
+ world.internalError(('conflicting top-level names in core "' + named.get$name() + '" ') + ('(previously defined in ' + existing.get$span().get$locationText() + ')'), (($0 = named.get$span()) && $0.is$SourceSpan()));
}
else {
this._topNames.$setindex(named.get$name(), named);
@@ -21924,10 +22260,11 @@ World.prototype._addTopName = function(named) {
}
}
World.prototype._addJavascriptTopName = function(named) {
+ var $0;
named.set$jsname(('' + named.get$library().get$jsname() + '_' + named.get$name() + ''));
var existing = this._topNames.$index(named.get$jsname());
if ($notnull_bool($ne(existing, null) && $ne(existing, named))) {
- world.internalError(('name mangling failed for "' + named.get$jsname() + '" ') + ('("' + named.get$jsname() + '" defined also in ' + existing.get$span().get$locationText() + ')'), named.get$span());
+ world.internalError(('name mangling failed for "' + named.get$jsname() + '" ') + ('("' + named.get$jsname() + '" defined also in ' + existing.get$span().get$locationText() + ')'), (($0 = named.get$span()) && $0.is$SourceSpan()));
}
this._topNames.$setindex(named.get$jsname(), named);
}
@@ -21993,9 +22330,10 @@ World.prototype.runCompilationPhases = function() {
})
);
this.withTiming('generate code', (function () {
- var mainMembers = lib.topType.resolveMember('main');
+ var $0;
+ var mainMembers = lib.get$topType().resolveMember$1('main');
var main = null;
- if ($notnull_bool(mainMembers == null || mainMembers.get$members().length == 0)) {
+ if ($notnull_bool(mainMembers == null || $eq(mainMembers.get$members().length, 0))) {
$this.fatal('no main method specified');
}
else if (mainMembers.get$members().length > 1) {
@@ -22003,7 +22341,7 @@ World.prototype.runCompilationPhases = function() {
for (var $i = mainMembers.get$members().iterator$0(); $i.hasNext$0(); ) {
var m = $i.next$0();
main = m;
- $this.error('more than one main member (using last?)', main.get$span());
+ $this.error('more than one main member (using last?)', (($0 = main.get$span()) && $0.is$SourceSpan()));
}
}
else {
@@ -22012,7 +22350,7 @@ World.prototype.runCompilationPhases = function() {
var codeWriter = new CodeWriter();
$this.gen = new WorldGenerator(main, codeWriter);
$this.gen.run();
- $this.jsBytesWritten = codeWriter.get$text().length;
+ $this.jsBytesWritten = $assert_num(codeWriter.get$text().length);
})
);
}
@@ -22240,7 +22578,7 @@ function FrogOptions(homedir, args, files) {
break loop;
}
else if ($notnull_bool(arg.startsWith$1('--out='))) {
- this.outfile = arg.substring$1('--out='.length);
+ this.outfile = $assert_String(arg.substring$1('--out='.length));
}
else if ($notnull_bool(arg.startsWith$1('--libdir='))) {
this.libDir = $assert_String(arg.substring$1('--libdir='.length));
@@ -22351,6 +22689,7 @@ function VarMethodStub(name, member, args, body) {
// Initializers done
}
$inherits(VarMethodStub, VarMember);
+VarMethodStub.prototype.get$body = function() { return this.body; };
VarMethodStub.prototype.get$returnType = function() {
var $0;
return (($0 = this.member != null ? this.member.get$returnType() : world.varType) && $0.is$lang_Type());
@@ -22380,7 +22719,7 @@ VarMethodStub.prototype._useDirectCall = function(member, args) {
}
for (var i = args.get$length();
i < method.parameters.length; i++) {
- if ($notnull_bool($ne(method.parameters.$index(i).get$value().code, 'null'))) {
+ if ($notnull_bool($ne(method.parameters.$index(i).get$value().get$code(), 'null'))) {
return false;
}
}
@@ -22421,14 +22760,14 @@ VarMethodSet.prototype._invokeMembers = function(context, node) {
var $list = this.members;
for (var $i = 0;$i < $list.length; $i++) {
var member = $list.$index($i);
- var target = new Value(member.declaringType, 'this', node.span, true);
+ var target = new Value(member.get$declaringType(), 'this', node.span, true);
var result = member.invoke$4(context, node, target, this.args);
var stub = new VarMethodStub(this.name, member, this.args, result);
- var type = member.declaringType;
+ var type = member.get$declaringType();
if ($notnull_bool(type.get$isObject())) {
objectStub = stub;
}
- else if ($ne(type.get$library(), world.get$dom())) {
+ else if ($notnull_bool($ne(type.get$library(), world.get$dom()))) {
VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$VarMember()));
}
else {
« no previous file with comments | « no previous file | frog/member.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698