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

Unified Diff: frog/frogsh

Issue 8457007: Better runtime type checks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged, and fix typo in member name 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
Index: frog/frogsh
diff --git a/frog/frogsh b/frog/frogsh
index 00b801dda58e002d4c94192ec1f645b0e9bb7ea2..71a4d60f22b3bdd568cc3456828166e6bd65320a 100755
--- a/frog/frogsh
+++ b/frog/frogsh
@@ -177,6 +177,13 @@ function $assert(test, text, url, line, column) {
if (!test) $throw(new AssertError(text, url, line, column));
}
+function $notnull_bool(test) {
+ if (test == null || typeof(test) != 'boolean') {
+ $throw(new TypeError('must be "true" or "false"'));
+ }
+ return test === true;
+}
+
function $throw(e) {
// If e is not a value, we can use V8's captureStackTrace utility method.
// TODO(jmesserly): capture the stack trace on other JS engines.
@@ -340,6 +347,17 @@ Clock.now = function() {
Clock.frequency = function() {
return 1000;
}
+// ********** Code for AssertError **************
+function AssertError(failedAssertion, url, line, column) {
+ this.failedAssertion = failedAssertion;
+ this.url = url;
+ this.line = line;
+ this.column = column;
+ // Initializers done
+}
+AssertError.prototype.toString = function() {
+ return ("Failed assertion: '" + this.failedAssertion + "' is not true ") + ("in " + this.url + " at line " + this.line + ", column " + this.column + ".");
+}
// ********** Code for Object **************
Object.prototype.get$dynamic = function() {
return this;
@@ -371,6 +389,10 @@ Object.prototype.visitPostfixExpression$1 = function($0) {
return this.noSuchMethod("visitPostfixExpression", [$0]);
}
;
+function $assert_bool(x) {
+ if (x == null || typeof(x) == "boolean") return x;
+ throw new TypeError("'" + x + "' is not a bool.");
+}
// ********** Code for IllegalAccessException **************
function IllegalAccessException() {
// Initializers done
@@ -388,8 +410,8 @@ function NoSuchMethodException(_receiver, _functionName, _arguments) {
NoSuchMethodException.prototype.toString = function() {
var sb = new StringBufferImpl("");
for (var i = 0;
- i < this._arguments.length; i++) {
- if (i > 0) {
+ $notnull_bool(i < this._arguments.length); i++) {
+ if ($notnull_bool(i > 0)) {
sb.add(", ");
}
sb.add(this._arguments.$index(i));
@@ -451,6 +473,14 @@ Math.min = function(a, b) {
if (isNaN(a)) return a;
else return b;
}
+function $assert_num(x) {
+ if (x == null || typeof(x) == "number") return x;
+ throw new TypeError("'" + x + "' is not a num.");
+}
+function $assert_String(x) {
+ if (x == null || typeof(x) == "string") return x;
+ throw new TypeError("'" + x + "' is not a String.");
+}
// ********** Code for Strings **************
function Strings() {}
Strings.String$fromCharCodes$factory = function(charCodes) {
@@ -473,7 +503,15 @@ function print(obj) {
// ********** Code for ListFactory **************
ListFactory = Array;
ListFactory.prototype.is$List = function(){return this;};
+ListFactory.prototype.is$List$ArgumentNode = function(){return this;};
+ListFactory.prototype.is$List$EvaluatedValue = function(){return this;};
+ListFactory.prototype.is$List$String = function(){return this;};
+ListFactory.prototype.is$List$T = function(){return this;};
+ListFactory.prototype.is$List$Value = function(){return this;};
+ListFactory.prototype.is$List$int = function(){return this;};
+ListFactory.prototype.is$Iterable = function(){return this;};
ListFactory.ListFactory$from$factory = function(other) {
+ var $0;
var list = [];
for (var $i = other.iterator(); $i.hasNext(); ) {
var e = $i.next();
@@ -488,6 +526,7 @@ ListFactory.prototype.addLast = function(value) {
this.push(value);
}
ListFactory.prototype.addAll = function(collection) {
+ var $0;
for (var $i = collection.iterator(); $i.hasNext(); ) {
var item = $i.next();
this.add(item);
@@ -534,8 +573,8 @@ ListIterator.prototype.hasNext = function() {
return this._array.length > this._pos;
}
ListIterator.prototype.next = function() {
- if (!this.hasNext()) {
- $throw(const$4/*const NoMoreElementsException()*/);
+ if ($notnull_bool(!this.hasNext())) {
+ $throw(const$0/*const NoMoreElementsException()*/);
}
return this._array.$index(this._pos++);
}
@@ -549,7 +588,7 @@ $inherits(ImmutableList, ListFactory$E);
ImmutableList.ImmutableList$from$factory = function(other) {
var list = new ImmutableList(other.length);
for (var i = 0;
- i < other.length; i++) {
+ $notnull_bool(i < other.length); i++) {
list._setindex(i, other.$index(i));
}
return list;
@@ -593,10 +632,11 @@ function ImmutableMap(keyValuePairs) {
this._internal = $map([]);
// Initializers done
for (var i = 0;
- i < keyValuePairs.length; i += 2) {
+ $notnull_bool(i < keyValuePairs.length); i += 2) {
this._internal.$setindex(keyValuePairs.$index(i), keyValuePairs.$index(i + 1));
}
}
+ImmutableMap.prototype.is$Map = function(){return this;};
ImmutableMap.prototype.$index = function(key) {
return this._internal.$index(key);
}
@@ -659,24 +699,24 @@ NumImplementation.prototype.toDouble = function() {
}
NumImplementation.prototype.compareTo = function(other) {
var thisValue = this.toDouble();
- if (thisValue < other) {
+ if ($notnull_bool(thisValue < other)) {
return -1;
}
- else if (thisValue > other) {
+ else if ($notnull_bool(thisValue > other)) {
return 1;
}
- else if (thisValue == other) {
- if (thisValue == 0) {
+ else if ($notnull_bool(thisValue == other)) {
+ if ($notnull_bool(thisValue == 0)) {
var thisIsNegative = this.isNegative();
var otherIsNegative = other.isNegative();
- if ($eq(thisIsNegative, otherIsNegative)) return 0;
- if (thisIsNegative) return -1;
+ if ($notnull_bool($eq(thisIsNegative, otherIsNegative))) return 0;
+ if ($notnull_bool(thisIsNegative)) return -1;
return 1;
}
return 0;
}
- else if (this.isNaN()) {
- if (other.isNaN()) {
+ else if ($notnull_bool(this.isNaN())) {
+ if ($notnull_bool(other.isNaN())) {
return 0;
}
return 1;
@@ -691,12 +731,12 @@ function ExceptionImplementation(_msg) {
// Initializers done
}
ExceptionImplementation.prototype.toString = function() {
- return (this._msg == null) ? "Exception" : ("Exception: " + this._msg + "");
+ return $notnull_bool((this._msg == null)) ? "Exception" : ("Exception: " + this._msg + "");
}
// ********** Code for HashMapImplementation **************
function HashMapImplementation() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -705,6 +745,7 @@ function HashMapImplementation() {
this._keys = new ListFactory(8/*HashMapImplementation._INITIAL_CAPACITY*/);
this._values = new ListFactory$V(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
+HashMapImplementation.prototype.is$Map = function(){return this;};
HashMapImplementation.HashMapImplementation$from$factory = function(other) {
var result = new HashMapImplementation();
other.forEach((function (key, value) {
@@ -723,46 +764,46 @@ HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
return (currentProbe + numberOfProbes) & (length0 - 1);
}
HashMapImplementation.prototype._probeForAdding = function(key) {
- var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length);
+ var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode()), this._keys.length);
var numberOfProbes = 1;
var initialHash = hash;
var insertionIndex = -1;
- while (true) {
+ while ($notnull_bool(true)) {
var existingKey = this._keys.$index(hash);
- if (existingKey == null) {
- if (insertionIndex < 0) return hash;
+ if ($notnull_bool(existingKey == null)) {
+ if ($notnull_bool(insertionIndex < 0)) return hash;
return insertionIndex;
}
- else if ($eq(existingKey, key)) {
+ else if ($notnull_bool($eq(existingKey, key))) {
return hash;
}
- else if ((insertionIndex < 0) && (HashMapImplementation._deletedKey === existingKey)) {
+ else if ($notnull_bool((insertionIndex < 0) && (HashMapImplementation._deletedKey === existingKey))) {
insertionIndex = hash;
}
hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.length);
}
}
HashMapImplementation.prototype._probeForLookup = function(key) {
- var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length);
+ var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode()), this._keys.length);
var numberOfProbes = 1;
var initialHash = hash;
- while (true) {
+ while ($notnull_bool(true)) {
var existingKey = this._keys.$index(hash);
- if (existingKey == null) return -1;
- if ($eq(existingKey, key)) return hash;
+ if ($notnull_bool(existingKey == null)) return -1;
+ if ($notnull_bool($eq(existingKey, key))) return hash;
hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.length);
}
}
HashMapImplementation.prototype._ensureCapacity = function() {
var newNumberOfEntries = this._numberOfEntries + 1;
- if (newNumberOfEntries >= this._loadLimit) {
+ if ($notnull_bool(newNumberOfEntries >= this._loadLimit)) {
this._grow(this._keys.length * 2);
return;
}
var capacity = this._keys.length;
var numberOfFreeOrDeleted = capacity - newNumberOfEntries;
var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted;
- if (this._numberOfDeleted > numberOfFree) {
+ if ($notnull_bool(this._numberOfDeleted > numberOfFree)) {
this._grow(this._keys.length);
}
}
@@ -770,6 +811,7 @@ HashMapImplementation._isPowerOfTwo = function(x) {
return ((x & (x - 1)) == 0);
}
HashMapImplementation.prototype._grow = function(newCapacity) {
+ $assert(HashMapImplementation._isPowerOfTwo(newCapacity), "_isPowerOfTwo(newCapacity)", "/Volumes/Data/dart/dart/corelib/src/implementation/hash_map_set.dart", 153, 12);
var capacity = this._keys.length;
this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity);
var oldKeys = this._keys;
@@ -777,9 +819,9 @@ HashMapImplementation.prototype._grow = function(newCapacity) {
this._keys = new ListFactory(newCapacity);
this._values = new ListFactory$V(newCapacity);
for (var i = 0;
- i < capacity; i++) {
+ $notnull_bool(i < capacity); i++) {
var key = oldKeys.$index(i);
- if (key == null || key === HashMapImplementation._deletedKey) {
+ if ($notnull_bool(key == null || key === HashMapImplementation._deletedKey)) {
continue;
}
var value = oldValues.$index(i);
@@ -794,7 +836,7 @@ HashMapImplementation.prototype.clear = function() {
this._numberOfDeleted = 0;
var length0 = this._keys.length;
for (var i = 0;
- i < length0; i++) {
+ $notnull_bool(i < length0); i++) {
this._keys.$setindex(i);
this._values.$setindex(i);
}
@@ -802,7 +844,7 @@ HashMapImplementation.prototype.clear = function() {
HashMapImplementation.prototype.$setindex = function(key, value) {
this._ensureCapacity();
var index = this._probeForAdding(key);
- if ((this._keys.$index(index) == null) || (this._keys.$index(index) === HashMapImplementation._deletedKey)) {
+ if ($notnull_bool((this._keys.$index(index) == null) || (this._keys.$index(index) === HashMapImplementation._deletedKey))) {
this._numberOfEntries++;
}
this._keys.$setindex(index, key);
@@ -810,12 +852,12 @@ HashMapImplementation.prototype.$setindex = function(key, value) {
}
HashMapImplementation.prototype.$index = function(key) {
var index = this._probeForLookup(key);
- if (index < 0) return null;
+ if ($notnull_bool(index < 0)) return null;
return this._values.$index(index);
}
HashMapImplementation.prototype.remove = function(key) {
var index = this._probeForLookup(key);
- if (index >= 0) {
+ if ($notnull_bool(index >= 0)) {
this._numberOfEntries--;
var value = this._values.$index(index);
this._values.$setindex(index);
@@ -837,8 +879,8 @@ Object.defineProperty(HashMapImplementation.prototype, "length", {
HashMapImplementation.prototype.forEach = function(f) {
var length0 = this._keys.length;
for (var i = 0;
- i < length0; i++) {
- if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImplementation._deletedKey)) {
+ $notnull_bool(i < length0); i++) {
+ if ($notnull_bool((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImplementation._deletedKey))) {
f(this._keys.$index(i), this._values.$index(i));
}
}
@@ -868,7 +910,7 @@ HashMapImplementation.prototype.forEach$1 = HashMapImplementation.prototype.forE
// ********** Code for HashMapImplementation$E$E **************
function HashMapImplementation$E$E() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -878,6 +920,7 @@ function HashMapImplementation$E$E() {
this._values = new ListFactory$E(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
$inherits(HashMapImplementation$E$E, HashMapImplementation);
+HashMapImplementation$E$E.prototype.is$Map = function(){return this;};
HashMapImplementation$E$E._computeLoadLimit = function(capacity) {
return $truncdiv((capacity * 3), 4);
}
@@ -888,46 +931,46 @@ HashMapImplementation$E$E._nextProbe = function(currentProbe, numberOfProbes, le
return (currentProbe + numberOfProbes) & (length0 - 1);
}
HashMapImplementation$E$E.prototype._probeForAdding = function(key) {
- var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length);
+ var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode()), this._keys.length);
var numberOfProbes = 1;
var initialHash = hash;
var insertionIndex = -1;
- while (true) {
+ while ($notnull_bool(true)) {
var existingKey = this._keys.$index(hash);
- if (existingKey == null) {
- if (insertionIndex < 0) return hash;
+ if ($notnull_bool(existingKey == null)) {
+ if ($notnull_bool(insertionIndex < 0)) return hash;
return insertionIndex;
}
- else if ($eq(existingKey, key)) {
+ else if ($notnull_bool($eq(existingKey, key))) {
return hash;
}
- else if ((insertionIndex < 0) && (HashMapImplementation._deletedKey === existingKey)) {
+ else if ($notnull_bool((insertionIndex < 0) && (HashMapImplementation._deletedKey === existingKey))) {
insertionIndex = hash;
}
hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.length);
}
}
HashMapImplementation$E$E.prototype._probeForLookup = function(key) {
- var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.length);
+ var hash = HashMapImplementation._firstProbe($assert_num(key.hashCode()), this._keys.length);
var numberOfProbes = 1;
var initialHash = hash;
- while (true) {
+ while ($notnull_bool(true)) {
var existingKey = this._keys.$index(hash);
- if (existingKey == null) return -1;
- if ($eq(existingKey, key)) return hash;
+ if ($notnull_bool(existingKey == null)) return -1;
+ if ($notnull_bool($eq(existingKey, key))) return hash;
hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.length);
}
}
HashMapImplementation$E$E.prototype._ensureCapacity = function() {
var newNumberOfEntries = this._numberOfEntries + 1;
- if (newNumberOfEntries >= this._loadLimit) {
+ if ($notnull_bool(newNumberOfEntries >= this._loadLimit)) {
this._grow(this._keys.length * 2);
return;
}
var capacity = this._keys.length;
var numberOfFreeOrDeleted = capacity - newNumberOfEntries;
var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted;
- if (this._numberOfDeleted > numberOfFree) {
+ if ($notnull_bool(this._numberOfDeleted > numberOfFree)) {
this._grow(this._keys.length);
}
}
@@ -935,6 +978,7 @@ HashMapImplementation$E$E._isPowerOfTwo = function(x) {
return ((x & (x - 1)) == 0);
}
HashMapImplementation$E$E.prototype._grow = function(newCapacity) {
+ $assert(HashMapImplementation._isPowerOfTwo(newCapacity), "_isPowerOfTwo(newCapacity)", "/Volumes/Data/dart/dart/corelib/src/implementation/hash_map_set.dart", 153, 12);
var capacity = this._keys.length;
this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity);
var oldKeys = this._keys;
@@ -942,9 +986,9 @@ HashMapImplementation$E$E.prototype._grow = function(newCapacity) {
this._keys = new ListFactory(newCapacity);
this._values = new ListFactory$E(newCapacity);
for (var i = 0;
- i < capacity; i++) {
+ $notnull_bool(i < capacity); i++) {
var key = oldKeys.$index(i);
- if (key == null || key === HashMapImplementation._deletedKey) {
+ if ($notnull_bool(key == null || key === HashMapImplementation._deletedKey)) {
continue;
}
var value = oldValues.$index(i);
@@ -957,7 +1001,7 @@ HashMapImplementation$E$E.prototype._grow = function(newCapacity) {
HashMapImplementation$E$E.prototype.$setindex = function(key, value) {
this._ensureCapacity();
var index = this._probeForAdding(key);
- if ((this._keys.$index(index) == null) || (this._keys.$index(index) === HashMapImplementation._deletedKey)) {
+ if ($notnull_bool((this._keys.$index(index) == null) || (this._keys.$index(index) === HashMapImplementation._deletedKey))) {
this._numberOfEntries++;
}
this._keys.$setindex(index, key);
@@ -965,7 +1009,7 @@ HashMapImplementation$E$E.prototype.$setindex = function(key, value) {
}
HashMapImplementation$E$E.prototype.remove = function(key) {
var index = this._probeForLookup(key);
- if (index >= 0) {
+ if ($notnull_bool(index >= 0)) {
this._numberOfEntries--;
var value = this._values.$index(index);
this._values.$setindex(index);
@@ -981,8 +1025,8 @@ HashMapImplementation$E$E.prototype.isEmpty = function() {
HashMapImplementation$E$E.prototype.forEach = function(f) {
var length0 = this._keys.length;
for (var i = 0;
- i < length0; i++) {
- if ((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImplementation._deletedKey)) {
+ $notnull_bool(i < length0); i++) {
+ if ($notnull_bool((this._keys.$index(i) != null) && (this._keys.$index(i) !== HashMapImplementation._deletedKey))) {
f(this._keys.$index(i), this._values.$index(i));
}
}
@@ -1002,7 +1046,7 @@ HashMapImplementation$E$E.prototype.containsKey = function(key) {
// ********** Code for HashMapImplementation$HInstruction$HInstruction **************
function HashMapImplementation$HInstruction$HInstruction() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -1012,13 +1056,14 @@ function HashMapImplementation$HInstruction$HInstruction() {
this._values = new ListFactory$HInstruction(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
$inherits(HashMapImplementation$HInstruction$HInstruction, HashMapImplementation);
+HashMapImplementation$HInstruction$HInstruction.prototype.is$Map = function(){return this;};
HashMapImplementation$HInstruction$HInstruction._computeLoadLimit = function(capacity) {
return $truncdiv((capacity * 3), 4);
}
// ********** Code for HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V **************
function HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -1028,13 +1073,14 @@ function HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V() {
this._values = new ListFactory$DoubleLinkedQueueEntry$KeyValuePair$K$V(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
$inherits(HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V, HashMapImplementation);
+HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V.prototype.is$Map = function(){return this;};
HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V._computeLoadLimit = function(capacity) {
return $truncdiv((capacity * 3), 4);
}
// ********** Code for HashMapImplementation$Node$Element **************
function HashMapImplementation$Node$Element() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -1044,13 +1090,14 @@ function HashMapImplementation$Node$Element() {
this._values = new ListFactory$Element(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
$inherits(HashMapImplementation$Node$Element, HashMapImplementation);
+HashMapImplementation$Node$Element.prototype.is$Map = function(){return this;};
HashMapImplementation$Node$Element._computeLoadLimit = function(capacity) {
return $truncdiv((capacity * 3), 4);
}
// ********** Code for HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword **************
function HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -1060,13 +1107,14 @@ function HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String
this._values = new ListFactory$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
$inherits(HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword, HashMapImplementation);
+HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword.prototype.is$Map = function(){return this;};
HashMapImplementation$String$DoubleLinkedQueueEntry$KeyValuePair$String$Keyword._computeLoadLimit = function(capacity) {
return $truncdiv((capacity * 3), 4);
}
// ********** Code for HashMapImplementation$String$EvaluatedValue **************
function HashMapImplementation$String$EvaluatedValue() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -1076,13 +1124,14 @@ function HashMapImplementation$String$EvaluatedValue() {
this._values = new ListFactory$EvaluatedValue(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
$inherits(HashMapImplementation$String$EvaluatedValue, HashMapImplementation);
+HashMapImplementation$String$EvaluatedValue.prototype.is$Map = function(){return this;};
HashMapImplementation$String$EvaluatedValue._computeLoadLimit = function(capacity) {
return $truncdiv((capacity * 3), 4);
}
// ********** Code for HashMapImplementation$String$String **************
function HashMapImplementation$String$String() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -1092,13 +1141,14 @@ function HashMapImplementation$String$String() {
this._values = new ListFactory$String(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
$inherits(HashMapImplementation$String$String, HashMapImplementation);
+HashMapImplementation$String$String.prototype.is$Map = function(){return this;};
HashMapImplementation$String$String._computeLoadLimit = function(capacity) {
return $truncdiv((capacity * 3), 4);
}
// ********** Code for HashMapImplementation$Type$Type **************
function HashMapImplementation$Type$Type() {
// Initializers done
- if (HashMapImplementation._deletedKey == null) {
+ if ($notnull_bool(HashMapImplementation._deletedKey == null)) {
HashMapImplementation._deletedKey = new Object();
}
this._numberOfEntries = 0;
@@ -1108,6 +1158,7 @@ function HashMapImplementation$Type$Type() {
this._values = new ListFactory$Type(8/*HashMapImplementation._INITIAL_CAPACITY*/);
}
$inherits(HashMapImplementation$Type$Type, HashMapImplementation);
+HashMapImplementation$Type$Type.prototype.is$Map = function(){return this;};
HashMapImplementation$Type$Type._computeLoadLimit = function(capacity) {
return $truncdiv((capacity * 3), 4);
}
@@ -1116,7 +1167,9 @@ function HashSetImplementation() {
// Initializers done
this._backingMap = new HashMapImplementation$E$E();
}
+HashSetImplementation.prototype.is$Iterable = function(){return this;};
HashSetImplementation.HashSetImplementation$from$factory = function(other) {
+ var $0;
var set = new HashSetImplementation();
for (var $i = other.iterator(); $i.hasNext(); ) {
var e = $i.next();
@@ -1131,7 +1184,7 @@ HashSetImplementation.prototype.contains = function(value) {
return this._backingMap.containsKey(value);
}
HashSetImplementation.prototype.remove = function(value) {
- if (!this._backingMap.containsKey(value)) return false;
+ if ($notnull_bool(!this._backingMap.containsKey(value))) return false;
this._backingMap.remove(value);
return true;
}
@@ -1151,7 +1204,7 @@ HashSetImplementation.prototype.forEach = function(f) {
HashSetImplementation.prototype.filter = function(f) {
var result = new HashSetImplementation$E();
this._backingMap.forEach(function _(key, value) {
- if (f(key)) result.add(key);
+ if ($notnull_bool(f(key))) result.add(key);
}
);
return result;
@@ -1179,18 +1232,21 @@ function HashSetImplementation$E() {
this._backingMap = new HashMapImplementation$E$E();
}
$inherits(HashSetImplementation$E, HashSetImplementation);
+HashSetImplementation$E.prototype.is$Iterable = function(){return this;};
// ********** Code for HashSetImplementation$String **************
function HashSetImplementation$String() {
// Initializers done
this._backingMap = new HashMapImplementation$String$String();
}
$inherits(HashSetImplementation$String, HashSetImplementation);
+HashSetImplementation$String.prototype.is$Iterable = function(){return this;};
// ********** Code for HashSetImplementation$Type **************
function HashSetImplementation$Type() {
// Initializers done
this._backingMap = new HashMapImplementation$Type$Type();
}
$inherits(HashSetImplementation$Type, HashSetImplementation);
+HashSetImplementation$Type.prototype.is$Iterable = function(){return this;};
// ********** Code for HashSetIterator **************
function HashSetIterator(set_) {
this._nextValidIndex = -1;
@@ -1199,15 +1255,15 @@ function HashSetIterator(set_) {
this._advance();
}
HashSetIterator.prototype.hasNext = function() {
- if (this._nextValidIndex >= this._entries.length) return false;
- if (this._entries.$index(this._nextValidIndex) === HashMapImplementation._deletedKey) {
+ if ($notnull_bool(this._nextValidIndex >= this._entries.length)) return false;
+ if ($notnull_bool(this._entries.$index(this._nextValidIndex) === HashMapImplementation._deletedKey)) {
this._advance();
}
return this._nextValidIndex < this._entries.length;
}
HashSetIterator.prototype.next = function() {
- if (!this.hasNext()) {
- $throw(const$4/*const NoMoreElementsException()*/);
+ if ($notnull_bool(!this.hasNext())) {
+ $throw(const$0/*const NoMoreElementsException()*/);
}
var res = this._entries.$index(this._nextValidIndex);
this._advance();
@@ -1218,10 +1274,10 @@ HashSetIterator.prototype._advance = function() {
var entry;
var deletedKey = HashMapImplementation._deletedKey;
do {
- if (++this._nextValidIndex >= length) break;
+ if ($notnull_bool(++this._nextValidIndex >= length)) break;
entry = this._entries.$index(this._nextValidIndex);
}
- while ((entry == null) || (entry === deletedKey))
+ while ($notnull_bool((entry == null) || (entry === deletedKey)))
}
// ********** Code for HashSetIterator$E **************
function HashSetIterator$E(set_) {
@@ -1236,10 +1292,10 @@ HashSetIterator$E.prototype._advance = function() {
var entry;
var deletedKey = HashMapImplementation._deletedKey;
do {
- if (++this._nextValidIndex >= length) break;
+ if ($notnull_bool(++this._nextValidIndex >= length)) break;
entry = this._entries.$index(this._nextValidIndex);
}
- while ((entry == null) || (entry === deletedKey))
+ while ($notnull_bool((entry == null) || (entry === deletedKey)))
}
// ********** Code for KeyValuePair **************
function KeyValuePair(key, value) {
@@ -1265,8 +1321,9 @@ function LinkedHashMapImplementation() {
this._map = new HashMapImplementation$K$DoubleLinkedQueueEntry$KeyValuePair$K$V();
this._list = new DoubleLinkedQueue$KeyValuePair$K$V();
}
+LinkedHashMapImplementation.prototype.is$Map = function(){return this;};
LinkedHashMapImplementation.prototype.$setindex = function(key, value) {
- if (this._map.containsKey(key)) {
+ if ($notnull_bool(this._map.containsKey(key))) {
this._map.$index(key).get$element().value = value;
}
else {
@@ -1276,7 +1333,7 @@ LinkedHashMapImplementation.prototype.$setindex = function(key, value) {
}
LinkedHashMapImplementation.prototype.$index = function(key) {
var entry = this._map.$index(key);
- if (entry == null) return null;
+ if ($notnull_bool(entry == null)) return null;
return entry.get$element().get$value();
}
LinkedHashMapImplementation.prototype.getKeys = function() {
@@ -1286,6 +1343,7 @@ LinkedHashMapImplementation.prototype.getKeys = function() {
list.$setindex(index++, entry.key);
}
);
+ $assert(index == this.get$length(), "index == length", "/Volumes/Data/dart/dart/corelib/src/implementation/linked_hash_map.dart", 75, 12);
return list;
}
LinkedHashMapImplementation.prototype.getValues = function() {
@@ -1295,6 +1353,7 @@ LinkedHashMapImplementation.prototype.getValues = function() {
list.$setindex(index++, entry.value);
}
);
+ $assert(index == this.get$length(), "index == length", "/Volumes/Data/dart/dart/corelib/src/implementation/linked_hash_map.dart", 86, 12);
return list;
}
LinkedHashMapImplementation.prototype.forEach = function(f) {
@@ -1327,6 +1386,7 @@ function LinkedHashMapImplementation$String$Keyword() {
this._list = new DoubleLinkedQueue$KeyValuePair$String$Keyword();
}
$inherits(LinkedHashMapImplementation$String$Keyword, LinkedHashMapImplementation);
+LinkedHashMapImplementation$String$Keyword.prototype.is$Map = function(){return this;};
// ********** Code for DoubleLinkedQueueEntry **************
function DoubleLinkedQueueEntry(e) {
// Initializers done
@@ -1469,7 +1529,9 @@ function DoubleLinkedQueue() {
// Initializers done
this._sentinel = new _DoubleLinkedQueueEntrySentinel$E();
}
+DoubleLinkedQueue.prototype.is$Iterable = function(){return this;};
DoubleLinkedQueue.DoubleLinkedQueue$from$factory = function(other) {
+ var $0;
var list = new DoubleLinkedQueue();
for (var $i = other.iterator(); $i.hasNext(); ) {
var e = $i.next();
@@ -1484,6 +1546,7 @@ DoubleLinkedQueue.prototype.add = function(value) {
this.addLast(value);
}
DoubleLinkedQueue.prototype.addAll = function(collection) {
+ var $0;
for (var $i = collection.iterator(); $i.hasNext(); ) {
var e = $i.next();
this.add(e);
@@ -1518,15 +1581,15 @@ DoubleLinkedQueue.prototype.clear = function() {
}
DoubleLinkedQueue.prototype.forEach = function(f) {
var entry = this._sentinel._next;
- while (entry !== this._sentinel) {
+ while ($notnull_bool(entry !== this._sentinel)) {
f(entry._element);
entry = entry._next;
}
}
DoubleLinkedQueue.prototype.some = function(f) {
var entry = this._sentinel._next;
- while (entry !== this._sentinel) {
- if (f(entry._element)) return true;
+ while ($notnull_bool(entry !== this._sentinel)) {
+ if ($notnull_bool(f(entry._element))) return true;
entry = entry._next;
}
return false;
@@ -1534,8 +1597,8 @@ DoubleLinkedQueue.prototype.some = function(f) {
DoubleLinkedQueue.prototype.filter = function(f) {
var other = new DoubleLinkedQueue$E();
var entry = this._sentinel._next;
- while (entry !== this._sentinel) {
- if (f(entry._element)) other.addLast(entry._element);
+ while ($notnull_bool(entry !== this._sentinel)) {
+ if ($notnull_bool(f(entry._element))) other.addLast(entry._element);
entry = entry._next;
}
return other;
@@ -1550,12 +1613,14 @@ function DoubleLinkedQueue$E() {
this._sentinel = new _DoubleLinkedQueueEntrySentinel$E();
}
$inherits(DoubleLinkedQueue$E, DoubleLinkedQueue);
+DoubleLinkedQueue$E.prototype.is$Iterable = function(){return this;};
// ********** Code for DoubleLinkedQueue$KeyValuePair$K$V **************
function DoubleLinkedQueue$KeyValuePair$K$V() {
// Initializers done
this._sentinel = new _DoubleLinkedQueueEntrySentinel$KeyValuePair$K$V();
}
$inherits(DoubleLinkedQueue$KeyValuePair$K$V, DoubleLinkedQueue);
+DoubleLinkedQueue$KeyValuePair$K$V.prototype.is$Iterable = function(){return this;};
DoubleLinkedQueue$KeyValuePair$K$V.prototype.addLast = function(value) {
this._sentinel.prepend(value);
}
@@ -1568,7 +1633,7 @@ DoubleLinkedQueue$KeyValuePair$K$V.prototype.clear = function() {
}
DoubleLinkedQueue$KeyValuePair$K$V.prototype.forEach = function(f) {
var entry = this._sentinel._next;
- while (entry !== this._sentinel) {
+ while ($notnull_bool(entry !== this._sentinel)) {
f(entry._element);
entry = entry._next;
}
@@ -1579,10 +1644,13 @@ function DoubleLinkedQueue$KeyValuePair$String$Keyword() {
this._sentinel = new _DoubleLinkedQueueEntrySentinel$KeyValuePair$String$Keyword();
}
$inherits(DoubleLinkedQueue$KeyValuePair$String$Keyword, DoubleLinkedQueue);
+DoubleLinkedQueue$KeyValuePair$String$Keyword.prototype.is$Iterable = function(){return this;};
// ********** Code for DoubleLinkedQueue$SourceString **************
function DoubleLinkedQueue$SourceString() {}
$inherits(DoubleLinkedQueue$SourceString, DoubleLinkedQueue);
+DoubleLinkedQueue$SourceString.prototype.is$Iterable = function(){return this;};
DoubleLinkedQueue$SourceString.DoubleLinkedQueue$from$factory = function(other) {
+ var $0;
var list = new DoubleLinkedQueue();
for (var $i = other.iterator(); $i.hasNext(); ) {
var e = $i.next();
@@ -1600,8 +1668,8 @@ _DoubleLinkedQueueIterator.prototype.hasNext = function() {
return this._currentEntry._next !== this._sentinel;
}
_DoubleLinkedQueueIterator.prototype.next = function() {
- if (!this.hasNext()) {
- $throw(const$4/*const NoMoreElementsException()*/);
+ if ($notnull_bool(!this.hasNext())) {
+ $throw(const$0/*const NoMoreElementsException()*/);
}
this._currentEntry = this._currentEntry._next;
return this._currentEntry.get$element();
@@ -1620,27 +1688,27 @@ function StopWatchImplementation() {
// Initializers done
}
StopWatchImplementation.prototype.start = function() {
- if (this._start == null) {
+ if ($notnull_bool(this._start == null)) {
this._start = Clock.now();
}
else {
- if (this._stop == null) {
+ if ($notnull_bool(this._stop == null)) {
return;
}
this._start = Clock.now() - (this._stop - this._start);
}
}
StopWatchImplementation.prototype.stop = function() {
- if (this._start == null) {
+ if ($notnull_bool(this._start == null)) {
return;
}
this._stop = Clock.now();
}
StopWatchImplementation.prototype.elapsed = function() {
- if (this._start == null) {
+ if ($notnull_bool(this._start == null)) {
return 0;
}
- return (this._stop == null) ? (Clock.now() - this._start) : (this._stop - this._start);
+ return $notnull_bool((this._stop == null)) ? (Clock.now() - this._start) : (this._stop - this._start);
}
StopWatchImplementation.prototype.elapsedInMs = function() {
return $truncdiv((this.elapsed() * 1000), this.frequency());
@@ -1654,6 +1722,7 @@ function StringBufferImpl(content) {
this.clear();
this.add(content);
}
+StringBufferImpl.prototype.is$StringBuffer = function(){return this;};
StringBufferImpl.prototype.get$length = function() {
return this._length;
}
@@ -1665,12 +1734,13 @@ StringBufferImpl.prototype.isEmpty = function() {
}
StringBufferImpl.prototype.add = function(obj) {
var str = obj.toString();
- if (str == null || str.isEmpty()) return this;
+ if ($notnull_bool(str == null || str.isEmpty())) return this;
this._buffer.add(str);
this._length += str.length;
return this;
}
StringBufferImpl.prototype.addAll = function(objects) {
+ var $0;
for (var $i = objects.iterator(); $i.hasNext(); ) {
var obj = $i.next();
this.add(obj);
@@ -1683,8 +1753,8 @@ StringBufferImpl.prototype.clear = function() {
return this;
}
StringBufferImpl.prototype.toString = function() {
- if (this._buffer.length == 0) return "";
- if (this._buffer.length == 1) return this._buffer.$index(0);
+ if ($notnull_bool(this._buffer.length == 0)) return "";
+ if ($notnull_bool(this._buffer.length == 1)) return this._buffer.$index(0);
var result = StringBase.concatAll(this._buffer);
this._buffer.clear();
this._buffer.add(result);
@@ -1704,10 +1774,10 @@ StringBase.createFromCharCodes = function(charCodes) {
return String.fromCharCode.apply(null, charCodes);
}
StringBase.join = function(strings, separator) {
- if (strings.length == 0) return '';
+ if ($notnull_bool(strings.length == 0)) return '';
var s = strings.$index(0);
for (var i = 1;
- i < strings.length; i++) {
+ $notnull_bool(i < strings.length); i++) {
s = s + separator + strings.$index(i);
}
return s;
@@ -1760,22 +1830,25 @@ StringImplementation.prototype.compareTo = function(other) {
// ********** Code for Collections **************
function Collections() {}
Collections.forEach = function(iterable, f) {
+ var $0;
for (var $i = iterable.iterator(); $i.hasNext(); ) {
var e = $i.next();
f(e);
}
}
Collections.some = function(iterable, f) {
+ var $0;
for (var $i = iterable.iterator(); $i.hasNext(); ) {
var e = $i.next();
- if (f(e)) return true;
+ if ($notnull_bool(f(e))) return true;
}
return false;
}
Collections.filter = function(source, destination, f) {
+ var $0;
for (var $i = source.iterator(); $i.hasNext(); ) {
var e = $i.next();
- if (f(e)) destination.add(e);
+ if ($notnull_bool(f(e))) destination.add(e);
}
return destination;
}
@@ -1796,7 +1869,7 @@ DateImplementation.now$ctor = function() {
DateImplementation.now$ctor.prototype = DateImplementation.prototype;
DateImplementation.prototype.get$value = function() { return this.value; };
DateImplementation.prototype.$eq = function(other) {
- if (!((other instanceof DateImplementation))) return false;
+ if ($notnull_bool(!((other instanceof DateImplementation)))) return false;
return (this.value == other.get$value()) && ($eq(this.timeZone, other.timeZone));
}
DateImplementation.prototype.compareTo = function(other) {
@@ -1828,12 +1901,12 @@ DateImplementation.prototype.get$milliseconds = function() {
}
DateImplementation.prototype.toString = function() {
function threeDigits(n) {
- if (n >= 100) return ("" + n + "");
- if (n > 10) return ("0" + n + "");
+ if ($notnull_bool(n >= 100)) return ("" + n + "");
+ if ($notnull_bool(n > 10)) return ("0" + n + "");
return ("00" + n + "");
}
function twoDigits(n) {
- if (n >= 10) return ("" + n + "");
+ if ($notnull_bool(n >= 10)) return ("" + n + "");
return ("0" + n + "");
}
var m = twoDigits(this.get$month());
@@ -1842,7 +1915,7 @@ DateImplementation.prototype.toString = function() {
var min = twoDigits(this.get$minutes());
var sec = twoDigits(this.get$seconds());
var ms = threeDigits(this.get$milliseconds());
- if (this.timeZone.isUtc) {
+ if ($notnull_bool(this.timeZone.isUtc)) {
return ("" + this.get$year() + "-" + m + "-" + d + " " + h + ":" + min + ":" + sec + "." + ms + "Z");
}
else {
@@ -1869,11 +1942,11 @@ TimeZoneImplementation.local$ctor = function() {
}
TimeZoneImplementation.local$ctor.prototype = TimeZoneImplementation.prototype;
TimeZoneImplementation.prototype.$eq = function(other) {
- if (!((other instanceof TimeZoneImplementation))) return false;
+ if ($notnull_bool(!((other instanceof TimeZoneImplementation)))) return false;
return $eq(this.isUtc, other.isUtc);
}
TimeZoneImplementation.prototype.toString = function() {
- if (this.isUtc) return "TimeZone (UTC)";
+ if ($notnull_bool(this.isUtc)) return "TimeZone (UTC)";
return "TimeZone (Local)";
}
// ********** Code for top level **************
@@ -1922,21 +1995,21 @@ function joinPaths(path1, path2) {
var $list = path2.split('/');
for (var $i = 0;$i < $list.length; $i++) {
var piece = $list.$index($i);
- if ($eq(piece, '..') && pieces.length > 0 && $ne(pieces.last(), '.') && $ne(pieces.last(), '..')) {
+ if ($notnull_bool($eq(piece, '..') && pieces.length > 0 && $ne(pieces.last(), '.') && $ne(pieces.last(), '..'))) {
pieces.removeLast();
}
- else if ($ne(piece, '')) {
- if (pieces.length > 0 && $eq(pieces.last(), '.')) {
+ else if ($notnull_bool($ne(piece, ''))) {
+ if ($notnull_bool(pieces.length > 0 && $eq(pieces.last(), '.'))) {
pieces.removeLast();
}
pieces.add(piece);
}
}
- return Strings.join(pieces, '/');
+ return Strings.join((pieces && pieces.is$List$String()), '/');
}
function dirname(path) {
var lastSlash = path.lastIndexOf('/', path.length);
- if (lastSlash == -1) {
+ if ($notnull_bool(lastSlash == -1)) {
return '.';
}
else {
@@ -1945,7 +2018,7 @@ function dirname(path) {
}
function basename(path) {
var lastSlash = path.lastIndexOf('/', path.length);
- if (lastSlash == -1) {
+ if ($notnull_bool(lastSlash == -1)) {
return path;
}
else {
@@ -1991,7 +2064,7 @@ ArrayBasedScanner.prototype.advance = function() {
}
ArrayBasedScanner.prototype.select = function(choice, yes, no) {
var next = this.advance();
- if (next == choice) {
+ if ($notnull_bool(next == choice)) {
this.appendStringToken(1024/*null.UNKNOWN_TOKEN*/, yes);
return this.advance();
}
@@ -2041,7 +2114,7 @@ ArrayBasedScanner$String.prototype.advance = function() {
}
ArrayBasedScanner$String.prototype.select = function(choice, yes, no) {
var next = this.advance();
- if (next == choice) {
+ if ($notnull_bool(next == choice)) {
this.appendStringToken(1024/*null.UNKNOWN_TOKEN*/, yes);
return this.advance();
}
@@ -2076,7 +2149,7 @@ ArrayBasedScanner$String.prototype.appendWhiteSpace = function(next) {
}
ArrayBasedScanner$String.prototype.tokenize = function() {
var next = this.advance();
- while (next != -1) {
+ while ($notnull_bool(next != -1)) {
next = this.bigSwitch(next);
}
this.appendEofToken();
@@ -2296,10 +2369,10 @@ ArrayBasedScanner$String.prototype.bigSwitch = function(next) {
default:
- if (next == -1) {
+ if ($notnull_bool(next == -1)) {
return -1;
}
- if (next < 0x1f) {
+ if ($notnull_bool(next < 0x1f)) {
$throw(new MalformedInputException(this.charOffset));
}
return this.tokenizeIdentifier(next);
@@ -2307,12 +2380,12 @@ ArrayBasedScanner$String.prototype.bigSwitch = function(next) {
}
}
ArrayBasedScanner$String.prototype.tokenizeTag = function(next) {
- if (this.byteOffset == 0) {
- if (this.peek() == 33/*null.$BANG*/) {
+ if ($notnull_bool(this.byteOffset == 0)) {
+ if ($notnull_bool(this.peek() == 33/*null.$BANG*/)) {
do {
next = this.advance();
}
- while (next != 10/*null.$LF*/ && next != 13/*null.$CR*/)
+ while ($notnull_bool(next != 10/*null.$LF*/ && next != 13/*null.$CR*/))
return next;
}
}
@@ -2321,7 +2394,7 @@ ArrayBasedScanner$String.prototype.tokenizeTag = function(next) {
}
ArrayBasedScanner$String.prototype.tokenizeTilde = function(next) {
next = this.advance();
- if (next == 47/*null.$SLASH*/) {
+ if ($notnull_bool(next == 47/*null.$SLASH*/)) {
return this.select(61/*null.$EQ*/, "~/=", "~/");
}
else {
@@ -2331,7 +2404,7 @@ ArrayBasedScanner$String.prototype.tokenizeTilde = function(next) {
}
ArrayBasedScanner$String.prototype.tokenizeOpenBracket = function(next) {
next = this.advance();
- if (next == 93/*null.$RBRACKET*/) {
+ if ($notnull_bool(next == 93/*null.$RBRACKET*/)) {
return this.select(61/*null.$EQ*/, "[]=", "[]");
}
else {
@@ -2430,7 +2503,7 @@ ArrayBasedScanner$String.prototype.tokenizePlus = function(next) {
}
ArrayBasedScanner$String.prototype.tokenizeExclamation = function(next) {
next = this.advance();
- if (next == 61/*null.$EQ*/) {
+ if ($notnull_bool(next == 61/*null.$EQ*/)) {
return this.select(61/*null.$EQ*/, "!==", "!=");
}
this.appendStringToken(33/*null.BANG_TOKEN*/, "!");
@@ -2438,7 +2511,7 @@ ArrayBasedScanner$String.prototype.tokenizeExclamation = function(next) {
}
ArrayBasedScanner$String.prototype.tokenizeEquals = function(next) {
next = this.advance();
- if (next == 61/*null.$EQ*/) {
+ if ($notnull_bool(next == 61/*null.$EQ*/)) {
return this.select(61/*null.$EQ*/, "===", "==");
}
this.appendStringToken(61/*null.EQ_TOKEN*/, "=");
@@ -2501,7 +2574,7 @@ ArrayBasedScanner$String.prototype.tokenizeLessThan = function(next) {
}
ArrayBasedScanner$String.prototype.tokenizeNumber = function(next) {
var start = this.byteOffset;
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case 48/*null.$0*/:
@@ -2538,7 +2611,7 @@ ArrayBasedScanner$String.prototype.tokenizeNumber = function(next) {
}
ArrayBasedScanner$String.prototype.tokenizeHexOrNumber = function(next) {
var x = this.peek();
- if (x == 120/*null.$x*/ || x == 88/*null.$X*/) {
+ if ($notnull_bool(x == 120/*null.$x*/ || x == 88/*null.$X*/)) {
this.advance();
return this.tokenizeHex(x);
}
@@ -2547,7 +2620,7 @@ ArrayBasedScanner$String.prototype.tokenizeHexOrNumber = function(next) {
ArrayBasedScanner$String.prototype.tokenizeHex = function(next) {
var start = this.byteOffset;
var hasDigits = false;
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case 48/*null.$0*/:
@@ -2578,7 +2651,7 @@ ArrayBasedScanner$String.prototype.tokenizeHex = function(next) {
default:
- if (!hasDigits) {
+ if ($notnull_bool(!hasDigits)) {
$throw(new MalformedInputException(this.charOffset));
}
this.appendByteStringToken(120/*null.HEXADECIMAL_TOKEN*/, this.asciiString(start));
@@ -2620,7 +2693,7 @@ ArrayBasedScanner$String.prototype.tokenizeDotOrNumber = function(next) {
ArrayBasedScanner$String.prototype.tokenizeFractionPart = function(next, start) {
var done = false;
LOOP:
- while (!done) {
+ while ($notnull_bool(!done)) {
switch (next) {
case 48/*null.$0*/:
case 49/*null.$1*/:
@@ -2650,18 +2723,18 @@ ArrayBasedScanner$String.prototype.tokenizeFractionPart = function(next, start)
}
next = this.advance();
}
- if (next == 100/*null.$d*/ || next == 68/*null.$D*/) {
+ if ($notnull_bool(next == 100/*null.$d*/ || next == 68/*null.$D*/)) {
next = this.advance();
}
this.appendByteStringToken(100/*null.DOUBLE_TOKEN*/, this.asciiString(start));
return next;
}
ArrayBasedScanner$String.prototype.tokenizeExponent = function(next) {
- if (next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/) {
+ if ($notnull_bool(next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/)) {
next = this.advance();
}
var hasDigits = false;
- while (true) {
+ while ($notnull_bool(true)) {
switch (next) {
case 48/*null.$0*/:
case 49/*null.$1*/:
@@ -2679,7 +2752,7 @@ ArrayBasedScanner$String.prototype.tokenizeExponent = function(next) {
default:
- if (!hasDigits) {
+ if ($notnull_bool(!hasDigits)) {
$throw(new MalformedInputException(this.charOffset));
}
return next;
@@ -2712,7 +2785,7 @@ ArrayBasedScanner$String.prototype.tokenizeSlashOrComment = function(next) {
}
}
ArrayBasedScanner$String.prototype.tokenizeSingleLineComment = function(next) {
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case -1:
@@ -2726,7 +2799,7 @@ ArrayBasedScanner$String.prototype.tokenizeSingleLineComment = function(next) {
}
ArrayBasedScanner$String.prototype.tokenizeMultiLineComment = function(next) {
next = this.advance();
- while (true) {
+ while ($notnull_bool(true)) {
switch (next) {
case -1:
@@ -2735,10 +2808,10 @@ ArrayBasedScanner$String.prototype.tokenizeMultiLineComment = function(next) {
case 42/*null.$STAR*/:
next = this.advance();
- if (next == 47/*null.$SLASH*/) {
+ if ($notnull_bool(next == 47/*null.$SLASH*/)) {
return this.advance();
}
- else if (next == -1) {
+ else if ($notnull_bool(next == -1)) {
return next;
}
break;
@@ -2754,25 +2827,25 @@ ArrayBasedScanner$String.prototype.tokenizeMultiLineComment = function(next) {
ArrayBasedScanner$String.prototype.tokenizeIdentifier = function(next) {
var start = this.byteOffset;
var state = null;
- if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) {
+ if ($notnull_bool(97/*null.$a*/ <= next && next <= 122/*null.$z*/)) {
state = KeywordState.get$KEYWORD_STATE().next(next);
next = this.advance();
}
var isAscii = true;
- while (true) {
- if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) {
- if (state != null) {
+ while ($notnull_bool(true)) {
+ if ($notnull_bool(97/*null.$a*/ <= next && next <= 122/*null.$z*/)) {
+ if ($notnull_bool(state != null)) {
state = state.next(next);
}
}
- else if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$DOLLAR*/) {
+ else if ($notnull_bool((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$DOLLAR*/)) {
state = null;
}
- else if (next < 128) {
- if (state != null && state.isLeaf()) {
+ else if ($notnull_bool(next < 128)) {
+ if ($notnull_bool(state != null && state.isLeaf())) {
this.appendKeywordToken(state.get$keyword());
}
- else if (isAscii) {
+ else if ($notnull_bool(isAscii)) {
this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.asciiString(start));
}
else {
@@ -2785,7 +2858,7 @@ ArrayBasedScanner$String.prototype.tokenizeIdentifier = function(next) {
do {
next = this.nextByte();
}
- while (next > 127)
+ while ($notnull_bool(next > 127))
var string = this.utf8String(nonAsciiStart, -1).toString();
isAscii = false;
this.addToCharOffset(string.length);
@@ -2797,7 +2870,7 @@ ArrayBasedScanner$String.prototype.tokenizeIdentifier = function(next) {
ArrayBasedScanner$String.prototype.tokenizeRawString = function(next) {
var start = this.byteOffset;
next = this.advance();
- if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) {
+ if ($notnull_bool(next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/)) {
return this.tokenizeString(next, start, true);
}
else {
@@ -2807,9 +2880,9 @@ ArrayBasedScanner$String.prototype.tokenizeRawString = function(next) {
ArrayBasedScanner$String.prototype.tokenizeString = function(next, start, raw) {
var q = next;
next = this.advance();
- if (q == next) {
+ if ($notnull_bool(q == next)) {
next = this.advance();
- if (q == next) {
+ if ($notnull_bool(q == next)) {
return this.tokenizeMultiLineString(q, start, raw);
}
else {
@@ -2817,7 +2890,7 @@ ArrayBasedScanner$String.prototype.tokenizeString = function(next, start, raw) {
return next;
}
}
- if (raw) {
+ if ($notnull_bool(raw)) {
return this.tokenizeSingleLineRawString(next, q, start);
}
else {
@@ -2825,18 +2898,18 @@ ArrayBasedScanner$String.prototype.tokenizeString = function(next, start, raw) {
}
}
ArrayBasedScanner$String.prototype.tokenizeSingleLineString = function(next, q1, start) {
- while (next != -1) {
- if (next == q1) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q1)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
- else if (next == 92/*null.$BACKSLASH*/) {
+ else if ($notnull_bool(next == 92/*null.$BACKSLASH*/)) {
next = this.advance();
- if (next == -1) {
+ if ($notnull_bool(next == -1)) {
$throw(new MalformedInputException(this.charOffset));
}
}
- else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) {
+ else if ($notnull_bool(next == 10/*null.$LF*/ || next == 13/*null.$CR*/)) {
$throw(new MalformedInputException(this.charOffset));
}
next = this.advance();
@@ -2845,12 +2918,12 @@ ArrayBasedScanner$String.prototype.tokenizeSingleLineString = function(next, q1,
}
ArrayBasedScanner$String.prototype.tokenizeSingleLineRawString = function(next, q1, start) {
next = this.advance();
- while (next != -1) {
- if (next == q1) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q1)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
- else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) {
+ else if ($notnull_bool(next == 10/*null.$LF*/ || next == 13/*null.$CR*/)) {
$throw(new MalformedInputException(this.charOffset));
}
next = this.advance();
@@ -2859,12 +2932,12 @@ ArrayBasedScanner$String.prototype.tokenizeSingleLineRawString = function(next,
}
ArrayBasedScanner$String.prototype.tokenizeMultiLineString = function(q, start, raw) {
var next = this.advance();
- while (next != -1) {
- if (next == q) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q)) {
next = this.advance();
- if (next == q) {
+ if ($notnull_bool(next == q)) {
next = this.advance();
- if (next == q) {
+ if ($notnull_bool(next == q)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
@@ -2879,10 +2952,18 @@ ArrayBasedScanner$String.prototype.tokenizeMultiLineString = function(q, start,
// ********** Code for LinkFactory **************
function LinkFactory() {}
LinkFactory.Link$factory = function(head, tail) {
- return new LinkEntry(head, (tail == null) ? const$227/*const EmptyLink<DeclarationBuilder>()*/ : tail);
+ var $0;
+ return new LinkEntry(head, (($0 = $notnull_bool((tail == null)) ? const$227/*const EmptyLink<DeclarationBuilder>()*/ : tail) && $0.is$Link$T()));
}
// ********** Code for AbstractLink **************
function AbstractLink() {}
+AbstractLink.prototype.is$Link = function(){return this;};
+AbstractLink.prototype.is$Link$DeclarationBuilder = function(){return this;};
+AbstractLink.prototype.is$Link$Element = function(){return this;};
+AbstractLink.prototype.is$Link$Node = function(){return this;};
+AbstractLink.prototype.is$Link$T = function(){return this;};
+AbstractLink.prototype.is$Link$Type = function(){return this;};
+AbstractLink.prototype.is$Iterable = function(){return this;};
AbstractLink.prototype.get$head = function() {
$throw("bug");
}
@@ -2896,10 +2977,11 @@ AbstractLink.prototype.iterator = function() {
return this.toList().iterator();
}
AbstractLink.prototype.printOn = function(buffer, separatedBy) {
- if (this.isEmpty()) return;
+ var $0;
+ if ($notnull_bool(this.isEmpty())) return;
buffer.add(this.get$head());
for (var link = this.get$tail();
- !link.isEmpty(); link = link.get$tail()) {
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link())) {
buffer.add(separatedBy);
buffer.add(link.get$head());
}
@@ -2912,12 +2994,19 @@ AbstractLink.prototype.toString = function() {
return buffer.toString();
}
AbstractLink.prototype.printOn$1 = function($0) {
- return this.printOn($0, '');
+ return this.printOn(($0 && $0.is$StringBuffer()), '');
}
;
// ********** Code for AbstractLink$T **************
function AbstractLink$T() {}
$inherits(AbstractLink$T, AbstractLink);
+AbstractLink$T.prototype.is$Link = function(){return this;};
+AbstractLink$T.prototype.is$Link$DeclarationBuilder = function(){return this;};
+AbstractLink$T.prototype.is$Link$Element = function(){return this;};
+AbstractLink$T.prototype.is$Link$Node = function(){return this;};
+AbstractLink$T.prototype.is$Link$T = function(){return this;};
+AbstractLink$T.prototype.is$Link$Type = function(){return this;};
+AbstractLink$T.prototype.is$Iterable = function(){return this;};
AbstractLink$T.prototype.iterator = function() {
return this.toList().iterator();
}
@@ -2926,6 +3015,13 @@ function LinkTail() {
// Initializers done
}
$inherits(LinkTail, AbstractLink$T);
+LinkTail.prototype.is$Link = function(){return this;};
+LinkTail.prototype.is$Link$DeclarationBuilder = function(){return this;};
+LinkTail.prototype.is$Link$Element = function(){return this;};
+LinkTail.prototype.is$Link$Node = function(){return this;};
+LinkTail.prototype.is$Link$T = function(){return this;};
+LinkTail.prototype.is$Link$Type = function(){return this;};
+LinkTail.prototype.is$Iterable = function(){return this;};
LinkTail.prototype.get$head = function() {
return null;
}
@@ -2943,16 +3039,37 @@ function LinkTail$DeclarationBuilder() {
// Initializers done
}
$inherits(LinkTail$DeclarationBuilder, LinkTail);
+LinkTail$DeclarationBuilder.prototype.is$Link = function(){return this;};
+LinkTail$DeclarationBuilder.prototype.is$Link$DeclarationBuilder = function(){return this;};
+LinkTail$DeclarationBuilder.prototype.is$Link$Element = function(){return this;};
+LinkTail$DeclarationBuilder.prototype.is$Link$Node = function(){return this;};
+LinkTail$DeclarationBuilder.prototype.is$Link$T = function(){return this;};
+LinkTail$DeclarationBuilder.prototype.is$Link$Type = function(){return this;};
+LinkTail$DeclarationBuilder.prototype.is$Iterable = function(){return this;};
// ********** Code for LinkTail$Element **************
function LinkTail$Element() {
// Initializers done
}
$inherits(LinkTail$Element, LinkTail);
+LinkTail$Element.prototype.is$Link = function(){return this;};
+LinkTail$Element.prototype.is$Link$DeclarationBuilder = function(){return this;};
+LinkTail$Element.prototype.is$Link$Element = function(){return this;};
+LinkTail$Element.prototype.is$Link$Node = function(){return this;};
+LinkTail$Element.prototype.is$Link$T = function(){return this;};
+LinkTail$Element.prototype.is$Link$Type = function(){return this;};
+LinkTail$Element.prototype.is$Iterable = function(){return this;};
// ********** Code for LinkTail$Node **************
function LinkTail$Node() {
// Initializers done
}
$inherits(LinkTail$Node, LinkTail);
+LinkTail$Node.prototype.is$Link = function(){return this;};
+LinkTail$Node.prototype.is$Link$DeclarationBuilder = function(){return this;};
+LinkTail$Node.prototype.is$Link$Element = function(){return this;};
+LinkTail$Node.prototype.is$Link$Node = function(){return this;};
+LinkTail$Node.prototype.is$Link$T = function(){return this;};
+LinkTail$Node.prototype.is$Link$Type = function(){return this;};
+LinkTail$Node.prototype.is$Iterable = function(){return this;};
// ********** Code for LinkEntry **************
function LinkEntry(head, realTail) {
this.head = head;
@@ -2968,9 +3085,10 @@ LinkEntry.prototype.isEmpty = function() {
return false;
}
LinkEntry.prototype.toList = function() {
+ var $0;
var list = new ListFactory$T();
for (var link = this;
- !link.isEmpty(); link = link.get$tail()) {
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$T())) {
list.addLast(link.get$head());
}
return list;
@@ -2991,7 +3109,7 @@ function LinkBuilderImplementation() {
LinkBuilderImplementation.prototype.get$head = function() { return this.head; };
LinkBuilderImplementation.prototype.set$head = function(value) { return this.head = value; };
LinkBuilderImplementation.prototype.toLink = function() {
- if (this.head == null) return const$227/*const EmptyLink<DeclarationBuilder>()*/;
+ if ($notnull_bool(this.head == null)) return const$227/*const EmptyLink<DeclarationBuilder>()*/;
this.lastLink.realTail = const$227/*const EmptyLink<DeclarationBuilder>()*/;
var link = this.head;
this.lastLink = null;
@@ -3000,7 +3118,7 @@ LinkBuilderImplementation.prototype.toLink = function() {
}
LinkBuilderImplementation.prototype.addLast = function(t) {
var entry = new LinkEntry$T(t, null);
- if (this.head == null) {
+ if ($notnull_bool(this.head == null)) {
this.head = entry;
}
else {
@@ -3023,7 +3141,7 @@ $inherits(LinkBuilderImplementation$Type, LinkBuilderImplementation);
function AbstractScanner() {}
AbstractScanner.prototype.tokenize = function() {
var next = this.advance();
- while (next != -1) {
+ while ($notnull_bool(next != -1)) {
next = this.bigSwitch(next);
}
this.appendEofToken();
@@ -3243,10 +3361,10 @@ AbstractScanner.prototype.bigSwitch = function(next) {
default:
- if (next == -1) {
+ if ($notnull_bool(next == -1)) {
return -1;
}
- if (next < 0x1f) {
+ if ($notnull_bool(next < 0x1f)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
return this.tokenizeIdentifier(next);
@@ -3254,12 +3372,12 @@ AbstractScanner.prototype.bigSwitch = function(next) {
}
}
AbstractScanner.prototype.tokenizeTag = function(next) {
- if (this.get$byteOffset() == 0) {
- if (this.peek() == 33/*null.$BANG*/) {
+ if ($notnull_bool(this.get$byteOffset() == 0)) {
+ if ($notnull_bool(this.peek() == 33/*null.$BANG*/)) {
do {
next = this.advance();
}
- while (next != 10/*null.$LF*/ && next != 13/*null.$CR*/)
+ while ($notnull_bool(next != 10/*null.$LF*/ && next != 13/*null.$CR*/))
return next;
}
}
@@ -3268,7 +3386,7 @@ AbstractScanner.prototype.tokenizeTag = function(next) {
}
AbstractScanner.prototype.tokenizeTilde = function(next) {
next = this.advance();
- if (next == 47/*null.$SLASH*/) {
+ if ($notnull_bool(next == 47/*null.$SLASH*/)) {
return this.select(61/*null.$EQ*/, "~/=", "~/");
}
else {
@@ -3278,7 +3396,7 @@ AbstractScanner.prototype.tokenizeTilde = function(next) {
}
AbstractScanner.prototype.tokenizeOpenBracket = function(next) {
next = this.advance();
- if (next == 93/*null.$RBRACKET*/) {
+ if ($notnull_bool(next == 93/*null.$RBRACKET*/)) {
return this.select(61/*null.$EQ*/, "[]=", "[]");
}
else {
@@ -3377,7 +3495,7 @@ AbstractScanner.prototype.tokenizePlus = function(next) {
}
AbstractScanner.prototype.tokenizeExclamation = function(next) {
next = this.advance();
- if (next == 61/*null.$EQ*/) {
+ if ($notnull_bool(next == 61/*null.$EQ*/)) {
return this.select(61/*null.$EQ*/, "!==", "!=");
}
this.appendStringToken(33/*null.BANG_TOKEN*/, "!");
@@ -3385,7 +3503,7 @@ AbstractScanner.prototype.tokenizeExclamation = function(next) {
}
AbstractScanner.prototype.tokenizeEquals = function(next) {
next = this.advance();
- if (next == 61/*null.$EQ*/) {
+ if ($notnull_bool(next == 61/*null.$EQ*/)) {
return this.select(61/*null.$EQ*/, "===", "==");
}
this.appendStringToken(61/*null.EQ_TOKEN*/, "=");
@@ -3448,7 +3566,7 @@ AbstractScanner.prototype.tokenizeLessThan = function(next) {
}
AbstractScanner.prototype.tokenizeNumber = function(next) {
var start = this.get$byteOffset();
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case 48/*null.$0*/:
@@ -3485,7 +3603,7 @@ AbstractScanner.prototype.tokenizeNumber = function(next) {
}
AbstractScanner.prototype.tokenizeHexOrNumber = function(next) {
var x = this.peek();
- if (x == 120/*null.$x*/ || x == 88/*null.$X*/) {
+ if ($notnull_bool(x == 120/*null.$x*/ || x == 88/*null.$X*/)) {
this.advance();
return this.tokenizeHex(x);
}
@@ -3494,7 +3612,7 @@ AbstractScanner.prototype.tokenizeHexOrNumber = function(next) {
AbstractScanner.prototype.tokenizeHex = function(next) {
var start = this.get$byteOffset();
var hasDigits = false;
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case 48/*null.$0*/:
@@ -3525,7 +3643,7 @@ AbstractScanner.prototype.tokenizeHex = function(next) {
default:
- if (!hasDigits) {
+ if ($notnull_bool(!hasDigits)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
this.appendByteStringToken(120/*null.HEXADECIMAL_TOKEN*/, this.asciiString(start));
@@ -3567,7 +3685,7 @@ AbstractScanner.prototype.tokenizeDotOrNumber = function(next) {
AbstractScanner.prototype.tokenizeFractionPart = function(next, start) {
var done = false;
LOOP:
- while (!done) {
+ while ($notnull_bool(!done)) {
switch (next) {
case 48/*null.$0*/:
case 49/*null.$1*/:
@@ -3597,18 +3715,18 @@ AbstractScanner.prototype.tokenizeFractionPart = function(next, start) {
}
next = this.advance();
}
- if (next == 100/*null.$d*/ || next == 68/*null.$D*/) {
+ if ($notnull_bool(next == 100/*null.$d*/ || next == 68/*null.$D*/)) {
next = this.advance();
}
this.appendByteStringToken(100/*null.DOUBLE_TOKEN*/, this.asciiString(start));
return next;
}
AbstractScanner.prototype.tokenizeExponent = function(next) {
- if (next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/) {
+ if ($notnull_bool(next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/)) {
next = this.advance();
}
var hasDigits = false;
- while (true) {
+ while ($notnull_bool(true)) {
switch (next) {
case 48/*null.$0*/:
case 49/*null.$1*/:
@@ -3626,7 +3744,7 @@ AbstractScanner.prototype.tokenizeExponent = function(next) {
default:
- if (!hasDigits) {
+ if ($notnull_bool(!hasDigits)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
return next;
@@ -3659,7 +3777,7 @@ AbstractScanner.prototype.tokenizeSlashOrComment = function(next) {
}
}
AbstractScanner.prototype.tokenizeSingleLineComment = function(next) {
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case -1:
@@ -3673,7 +3791,7 @@ AbstractScanner.prototype.tokenizeSingleLineComment = function(next) {
}
AbstractScanner.prototype.tokenizeMultiLineComment = function(next) {
next = this.advance();
- while (true) {
+ while ($notnull_bool(true)) {
switch (next) {
case -1:
@@ -3682,10 +3800,10 @@ AbstractScanner.prototype.tokenizeMultiLineComment = function(next) {
case 42/*null.$STAR*/:
next = this.advance();
- if (next == 47/*null.$SLASH*/) {
+ if ($notnull_bool(next == 47/*null.$SLASH*/)) {
return this.advance();
}
- else if (next == -1) {
+ else if ($notnull_bool(next == -1)) {
return next;
}
break;
@@ -3701,25 +3819,25 @@ AbstractScanner.prototype.tokenizeMultiLineComment = function(next) {
AbstractScanner.prototype.tokenizeIdentifier = function(next) {
var start = this.get$byteOffset();
var state = null;
- if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) {
+ if ($notnull_bool(97/*null.$a*/ <= next && next <= 122/*null.$z*/)) {
state = KeywordState.get$KEYWORD_STATE().next(next);
next = this.advance();
}
var isAscii = true;
- while (true) {
- if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) {
- if (state != null) {
+ while ($notnull_bool(true)) {
+ if ($notnull_bool(97/*null.$a*/ <= next && next <= 122/*null.$z*/)) {
+ if ($notnull_bool(state != null)) {
state = state.next(next);
}
}
- else if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$DOLLAR*/) {
+ else if ($notnull_bool((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$DOLLAR*/)) {
state = null;
}
- else if (next < 128) {
- if (state != null && state.isLeaf()) {
+ else if ($notnull_bool(next < 128)) {
+ if ($notnull_bool(state != null && state.isLeaf())) {
this.appendKeywordToken(state.get$keyword());
}
- else if (isAscii) {
+ else if ($notnull_bool(isAscii)) {
this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.asciiString(start));
}
else {
@@ -3732,7 +3850,7 @@ AbstractScanner.prototype.tokenizeIdentifier = function(next) {
do {
next = this.nextByte();
}
- while (next > 127)
+ while ($notnull_bool(next > 127))
var string = this.utf8String(nonAsciiStart, -1).toString();
isAscii = false;
this.addToCharOffset(string.length);
@@ -3744,7 +3862,7 @@ AbstractScanner.prototype.tokenizeIdentifier = function(next) {
AbstractScanner.prototype.tokenizeRawString = function(next) {
var start = this.get$byteOffset();
next = this.advance();
- if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) {
+ if ($notnull_bool(next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/)) {
return this.tokenizeString(next, start, true);
}
else {
@@ -3754,9 +3872,9 @@ AbstractScanner.prototype.tokenizeRawString = function(next) {
AbstractScanner.prototype.tokenizeString = function(next, start, raw) {
var q = next;
next = this.advance();
- if (q == next) {
+ if ($notnull_bool(q == next)) {
next = this.advance();
- if (q == next) {
+ if ($notnull_bool(q == next)) {
return this.tokenizeMultiLineString(q, start, raw);
}
else {
@@ -3764,7 +3882,7 @@ AbstractScanner.prototype.tokenizeString = function(next, start, raw) {
return next;
}
}
- if (raw) {
+ if ($notnull_bool(raw)) {
return this.tokenizeSingleLineRawString(next, q, start);
}
else {
@@ -3772,18 +3890,18 @@ AbstractScanner.prototype.tokenizeString = function(next, start, raw) {
}
}
AbstractScanner.prototype.tokenizeSingleLineString = function(next, q1, start) {
- while (next != -1) {
- if (next == q1) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q1)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
- else if (next == 92/*null.$BACKSLASH*/) {
+ else if ($notnull_bool(next == 92/*null.$BACKSLASH*/)) {
next = this.advance();
- if (next == -1) {
+ if ($notnull_bool(next == -1)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
}
- else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) {
+ else if ($notnull_bool(next == 10/*null.$LF*/ || next == 13/*null.$CR*/)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
next = this.advance();
@@ -3792,12 +3910,12 @@ AbstractScanner.prototype.tokenizeSingleLineString = function(next, q1, start) {
}
AbstractScanner.prototype.tokenizeSingleLineRawString = function(next, q1, start) {
next = this.advance();
- while (next != -1) {
- if (next == q1) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q1)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
- else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) {
+ else if ($notnull_bool(next == 10/*null.$LF*/ || next == 13/*null.$CR*/)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
next = this.advance();
@@ -3806,12 +3924,12 @@ AbstractScanner.prototype.tokenizeSingleLineRawString = function(next, q1, start
}
AbstractScanner.prototype.tokenizeMultiLineString = function(q, start, raw) {
var next = this.advance();
- while (next != -1) {
- if (next == q) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q)) {
next = this.advance();
- if (next == q) {
+ if ($notnull_bool(next == q)) {
next = this.advance();
- if (next == q) {
+ if ($notnull_bool(next == q)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
@@ -3826,7 +3944,7 @@ function AbstractScanner$S() {}
$inherits(AbstractScanner$S, AbstractScanner);
AbstractScanner$S.prototype.tokenize = function() {
var next = this.advance();
- while (next != -1) {
+ while ($notnull_bool(next != -1)) {
next = this.bigSwitch(next);
}
this.appendEofToken();
@@ -4046,10 +4164,10 @@ AbstractScanner$S.prototype.bigSwitch = function(next) {
default:
- if (next == -1) {
+ if ($notnull_bool(next == -1)) {
return -1;
}
- if (next < 0x1f) {
+ if ($notnull_bool(next < 0x1f)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
return this.tokenizeIdentifier(next);
@@ -4057,12 +4175,12 @@ AbstractScanner$S.prototype.bigSwitch = function(next) {
}
}
AbstractScanner$S.prototype.tokenizeTag = function(next) {
- if (this.get$byteOffset() == 0) {
- if (this.peek() == 33/*null.$BANG*/) {
+ if ($notnull_bool(this.get$byteOffset() == 0)) {
+ if ($notnull_bool(this.peek() == 33/*null.$BANG*/)) {
do {
next = this.advance();
}
- while (next != 10/*null.$LF*/ && next != 13/*null.$CR*/)
+ while ($notnull_bool(next != 10/*null.$LF*/ && next != 13/*null.$CR*/))
return next;
}
}
@@ -4071,7 +4189,7 @@ AbstractScanner$S.prototype.tokenizeTag = function(next) {
}
AbstractScanner$S.prototype.tokenizeTilde = function(next) {
next = this.advance();
- if (next == 47/*null.$SLASH*/) {
+ if ($notnull_bool(next == 47/*null.$SLASH*/)) {
return this.select(61/*null.$EQ*/, "~/=", "~/");
}
else {
@@ -4081,7 +4199,7 @@ AbstractScanner$S.prototype.tokenizeTilde = function(next) {
}
AbstractScanner$S.prototype.tokenizeOpenBracket = function(next) {
next = this.advance();
- if (next == 93/*null.$RBRACKET*/) {
+ if ($notnull_bool(next == 93/*null.$RBRACKET*/)) {
return this.select(61/*null.$EQ*/, "[]=", "[]");
}
else {
@@ -4180,7 +4298,7 @@ AbstractScanner$S.prototype.tokenizePlus = function(next) {
}
AbstractScanner$S.prototype.tokenizeExclamation = function(next) {
next = this.advance();
- if (next == 61/*null.$EQ*/) {
+ if ($notnull_bool(next == 61/*null.$EQ*/)) {
return this.select(61/*null.$EQ*/, "!==", "!=");
}
this.appendStringToken(33/*null.BANG_TOKEN*/, "!");
@@ -4188,7 +4306,7 @@ AbstractScanner$S.prototype.tokenizeExclamation = function(next) {
}
AbstractScanner$S.prototype.tokenizeEquals = function(next) {
next = this.advance();
- if (next == 61/*null.$EQ*/) {
+ if ($notnull_bool(next == 61/*null.$EQ*/)) {
return this.select(61/*null.$EQ*/, "===", "==");
}
this.appendStringToken(61/*null.EQ_TOKEN*/, "=");
@@ -4251,7 +4369,7 @@ AbstractScanner$S.prototype.tokenizeLessThan = function(next) {
}
AbstractScanner$S.prototype.tokenizeNumber = function(next) {
var start = this.get$byteOffset();
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case 48/*null.$0*/:
@@ -4288,7 +4406,7 @@ AbstractScanner$S.prototype.tokenizeNumber = function(next) {
}
AbstractScanner$S.prototype.tokenizeHexOrNumber = function(next) {
var x = this.peek();
- if (x == 120/*null.$x*/ || x == 88/*null.$X*/) {
+ if ($notnull_bool(x == 120/*null.$x*/ || x == 88/*null.$X*/)) {
this.advance();
return this.tokenizeHex(x);
}
@@ -4297,7 +4415,7 @@ AbstractScanner$S.prototype.tokenizeHexOrNumber = function(next) {
AbstractScanner$S.prototype.tokenizeHex = function(next) {
var start = this.get$byteOffset();
var hasDigits = false;
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case 48/*null.$0*/:
@@ -4328,7 +4446,7 @@ AbstractScanner$S.prototype.tokenizeHex = function(next) {
default:
- if (!hasDigits) {
+ if ($notnull_bool(!hasDigits)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
this.appendByteStringToken(120/*null.HEXADECIMAL_TOKEN*/, this.asciiString(start));
@@ -4370,7 +4488,7 @@ AbstractScanner$S.prototype.tokenizeDotOrNumber = function(next) {
AbstractScanner$S.prototype.tokenizeFractionPart = function(next, start) {
var done = false;
LOOP:
- while (!done) {
+ while ($notnull_bool(!done)) {
switch (next) {
case 48/*null.$0*/:
case 49/*null.$1*/:
@@ -4400,18 +4518,18 @@ AbstractScanner$S.prototype.tokenizeFractionPart = function(next, start) {
}
next = this.advance();
}
- if (next == 100/*null.$d*/ || next == 68/*null.$D*/) {
+ if ($notnull_bool(next == 100/*null.$d*/ || next == 68/*null.$D*/)) {
next = this.advance();
}
this.appendByteStringToken(100/*null.DOUBLE_TOKEN*/, this.asciiString(start));
return next;
}
AbstractScanner$S.prototype.tokenizeExponent = function(next) {
- if (next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/) {
+ if ($notnull_bool(next == 43/*null.$PLUS*/ || next == 45/*null.$MINUS*/)) {
next = this.advance();
}
var hasDigits = false;
- while (true) {
+ while ($notnull_bool(true)) {
switch (next) {
case 48/*null.$0*/:
case 49/*null.$1*/:
@@ -4429,7 +4547,7 @@ AbstractScanner$S.prototype.tokenizeExponent = function(next) {
default:
- if (!hasDigits) {
+ if ($notnull_bool(!hasDigits)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
return next;
@@ -4462,7 +4580,7 @@ AbstractScanner$S.prototype.tokenizeSlashOrComment = function(next) {
}
}
AbstractScanner$S.prototype.tokenizeSingleLineComment = function(next) {
- while (true) {
+ while ($notnull_bool(true)) {
next = this.advance();
switch (next) {
case -1:
@@ -4476,7 +4594,7 @@ AbstractScanner$S.prototype.tokenizeSingleLineComment = function(next) {
}
AbstractScanner$S.prototype.tokenizeMultiLineComment = function(next) {
next = this.advance();
- while (true) {
+ while ($notnull_bool(true)) {
switch (next) {
case -1:
@@ -4485,10 +4603,10 @@ AbstractScanner$S.prototype.tokenizeMultiLineComment = function(next) {
case 42/*null.$STAR*/:
next = this.advance();
- if (next == 47/*null.$SLASH*/) {
+ if ($notnull_bool(next == 47/*null.$SLASH*/)) {
return this.advance();
}
- else if (next == -1) {
+ else if ($notnull_bool(next == -1)) {
return next;
}
break;
@@ -4504,25 +4622,25 @@ AbstractScanner$S.prototype.tokenizeMultiLineComment = function(next) {
AbstractScanner$S.prototype.tokenizeIdentifier = function(next) {
var start = this.get$byteOffset();
var state = null;
- if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) {
+ if ($notnull_bool(97/*null.$a*/ <= next && next <= 122/*null.$z*/)) {
state = KeywordState.get$KEYWORD_STATE().next(next);
next = this.advance();
}
var isAscii = true;
- while (true) {
- if (97/*null.$a*/ <= next && next <= 122/*null.$z*/) {
- if (state != null) {
+ while ($notnull_bool(true)) {
+ if ($notnull_bool(97/*null.$a*/ <= next && next <= 122/*null.$z*/)) {
+ if ($notnull_bool(state != null)) {
state = state.next(next);
}
}
- else if ((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$DOLLAR*/) {
+ else if ($notnull_bool((48/*null.$0*/ <= next && next <= 57/*null.$9*/) || (65/*null.$A*/ <= next && next <= 90/*null.$Z*/) || next == 95/*null.$_*/ || next == 36/*null.$DOLLAR*/)) {
state = null;
}
- else if (next < 128) {
- if (state != null && state.isLeaf()) {
+ else if ($notnull_bool(next < 128)) {
+ if ($notnull_bool(state != null && state.isLeaf())) {
this.appendKeywordToken(state.get$keyword());
}
- else if (isAscii) {
+ else if ($notnull_bool(isAscii)) {
this.appendByteStringToken(97/*null.IDENTIFIER_TOKEN*/, this.asciiString(start));
}
else {
@@ -4535,7 +4653,7 @@ AbstractScanner$S.prototype.tokenizeIdentifier = function(next) {
do {
next = this.nextByte();
}
- while (next > 127)
+ while ($notnull_bool(next > 127))
var string = this.utf8String(nonAsciiStart, -1).toString();
isAscii = false;
this.addToCharOffset(string.length);
@@ -4547,7 +4665,7 @@ AbstractScanner$S.prototype.tokenizeIdentifier = function(next) {
AbstractScanner$S.prototype.tokenizeRawString = function(next) {
var start = this.get$byteOffset();
next = this.advance();
- if (next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/) {
+ if ($notnull_bool(next == 34/*null.$DQ*/ || next == 39/*null.$SQ*/)) {
return this.tokenizeString(next, start, true);
}
else {
@@ -4557,9 +4675,9 @@ AbstractScanner$S.prototype.tokenizeRawString = function(next) {
AbstractScanner$S.prototype.tokenizeString = function(next, start, raw) {
var q = next;
next = this.advance();
- if (q == next) {
+ if ($notnull_bool(q == next)) {
next = this.advance();
- if (q == next) {
+ if ($notnull_bool(q == next)) {
return this.tokenizeMultiLineString(q, start, raw);
}
else {
@@ -4567,7 +4685,7 @@ AbstractScanner$S.prototype.tokenizeString = function(next, start, raw) {
return next;
}
}
- if (raw) {
+ if ($notnull_bool(raw)) {
return this.tokenizeSingleLineRawString(next, q, start);
}
else {
@@ -4575,18 +4693,18 @@ AbstractScanner$S.prototype.tokenizeString = function(next, start, raw) {
}
}
AbstractScanner$S.prototype.tokenizeSingleLineString = function(next, q1, start) {
- while (next != -1) {
- if (next == q1) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q1)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
- else if (next == 92/*null.$BACKSLASH*/) {
+ else if ($notnull_bool(next == 92/*null.$BACKSLASH*/)) {
next = this.advance();
- if (next == -1) {
+ if ($notnull_bool(next == -1)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
}
- else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) {
+ else if ($notnull_bool(next == 10/*null.$LF*/ || next == 13/*null.$CR*/)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
next = this.advance();
@@ -4595,12 +4713,12 @@ AbstractScanner$S.prototype.tokenizeSingleLineString = function(next, q1, start)
}
AbstractScanner$S.prototype.tokenizeSingleLineRawString = function(next, q1, start) {
next = this.advance();
- while (next != -1) {
- if (next == q1) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q1)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
- else if (next == 10/*null.$LF*/ || next == 13/*null.$CR*/) {
+ else if ($notnull_bool(next == 10/*null.$LF*/ || next == 13/*null.$CR*/)) {
$throw(new MalformedInputException(this.get$charOffset()));
}
next = this.advance();
@@ -4609,12 +4727,12 @@ AbstractScanner$S.prototype.tokenizeSingleLineRawString = function(next, q1, sta
}
AbstractScanner$S.prototype.tokenizeMultiLineString = function(q, start, raw) {
var next = this.advance();
- while (next != -1) {
- if (next == q) {
+ while ($notnull_bool(next != -1)) {
+ if ($notnull_bool(next == q)) {
next = this.advance();
- if (next == q) {
+ if ($notnull_bool(next == q)) {
next = this.advance();
- if (next == q) {
+ if ($notnull_bool(next == q)) {
this.appendByteStringToken(39/*null.STRING_TOKEN*/, this.utf8String(start, 0));
return this.advance();
}
@@ -4637,14 +4755,14 @@ Parser.prototype.next = function(token) {
return this.checkEof(token.next);
}
Parser.prototype.checkEof = function(token) {
- if (token.kind == 0/*null.EOF_TOKEN*/) {
+ if ($notnull_bool(token.kind == 0/*null.EOF_TOKEN*/)) {
this.listener.unexpectedEof();
$throw("Unexpected EOF");
}
return token;
}
Parser.prototype.parseUnit = function(token) {
- while (token.kind != 0/*null.EOF_TOKEN*/) {
+ while ($notnull_bool(token.kind != 0/*null.EOF_TOKEN*/)) {
switch (token.get$value()) {
case const$203/*Keyword.INTERFACE*/:
@@ -4663,7 +4781,7 @@ Parser.prototype.parseUnit = function(token) {
default:
- if ($eq(token.get$value(), const$237/*const SourceString("#")*/)) {
+ if ($notnull_bool($eq(token.get$value(), const$237/*const SourceString("#")*/))) {
token = this.parseLibraryTags(token);
}
else {
@@ -4697,7 +4815,7 @@ Parser.prototype.parseNamedFunctionAlias = function(token) {
return this.expect(const$236/*const SourceString(";")*/, token);
}
Parser.prototype.parseReturnTypeOpt = function(token) {
- if ($eq(token.get$value(), const$183/*Keyword.VOID*/)) {
+ if ($notnull_bool($eq(token.get$value(), const$183/*Keyword.VOID*/))) {
this.listener.voidType(token);
return this.next(token);
}
@@ -4707,14 +4825,14 @@ Parser.prototype.parseReturnTypeOpt = function(token) {
}
Parser.prototype.parseParameters = function(token) {
this.expect(const$234/*const SourceString("(")*/, token);
- if (this.optional(const$235/*const SourceString(")")*/, this.next(token))) {
+ if ($notnull_bool(this.optional(const$235/*const SourceString(")")*/, this.next(token)))) {
return this.next(this.next(token));
}
do {
token = this.parseTypeOpt(this.next(token));
token = this.parseIdentifier(token);
}
- while (this.optional(const$230/*const SourceString(",")*/, token))
+ while ($notnull_bool(this.optional(const$230/*const SourceString(",")*/, token)))
return this.expect(const$235/*const SourceString(")")*/, token);
}
Parser.prototype.parseTypeOpt = function(token) {
@@ -4748,22 +4866,22 @@ Parser.prototype.isIdentifier = function(token) {
}
}
Parser.prototype.parseSupertypesClauseOpt = function(token) {
- if (this.optional(const$193/*Keyword.EXTENDS*/, token)) {
+ if ($notnull_bool(this.optional(const$193/*Keyword.EXTENDS*/, token))) {
do {
token = this.parseType(this.next(token));
}
- while (this.optional(const$230/*const SourceString(",")*/, token))
+ while ($notnull_bool(this.optional(const$230/*const SourceString(",")*/, token)))
}
return token;
}
Parser.prototype.parseFactoryClauseOpt = function(token) {
- if (this.optional(const$195/*Keyword.FACTORY*/, token)) {
+ if ($notnull_bool(this.optional(const$195/*Keyword.FACTORY*/, token))) {
return this.parseType(this.next(token));
}
return token;
}
Parser.prototype.skipBlock = function(token) {
- if (!this.optional(const$232/*const SourceString("{")*/, token)) {
+ if ($notnull_bool(!this.optional(const$232/*const SourceString("{")*/, token))) {
return this.listener.expectedBlock(token);
}
token = this.next(token);
@@ -4778,7 +4896,7 @@ Parser.prototype.skipBlock = function(token) {
case 125/*null.RBRACE_TOKEN*/:
nesting--;
- if (nesting == 0) {
+ if ($notnull_bool(nesting == 0)) {
return token;
}
break;
@@ -4786,7 +4904,7 @@ Parser.prototype.skipBlock = function(token) {
}
token = this.next(token);
}
- while (token != null)
+ while ($notnull_bool(token != null))
$throw("Internal error: unreachable code");
}
Parser.prototype.parseClass = function(token) {
@@ -4799,7 +4917,7 @@ Parser.prototype.parseClass = function(token) {
return this.parseClassBody(token);
}
Parser.prototype.parseNativeClassClauseOpt = function(token) {
- if (this.optional(const$207/*Keyword.NATIVE*/, token)) {
+ if ($notnull_bool(this.optional(const$207/*Keyword.NATIVE*/, token))) {
return this.parseString(this.next(token));
}
return token;
@@ -4817,7 +4935,7 @@ Parser.prototype.parseString = function(token) {
}
}
Parser.prototype.parseIdentifier = function(token) {
- if (this.isIdentifier(token)) {
+ if ($notnull_bool(this.isIdentifier(token))) {
this.listener.identifier(token);
}
else {
@@ -4826,18 +4944,18 @@ Parser.prototype.parseIdentifier = function(token) {
return this.next(token);
}
Parser.prototype.parseTypeVariablesOpt = function(token) {
- if (!this.optional(const$228/*const SourceString("<")*/, token)) {
+ if ($notnull_bool(!this.optional(const$228/*const SourceString("<")*/, token))) {
return token;
}
this.listener.beginTypeVariables(token);
do {
token = this.parseTypeVariable(this.next(token));
}
- while (this.optional(const$230/*const SourceString(",")*/, token))
+ while ($notnull_bool(this.optional(const$230/*const SourceString(",")*/, token)))
return this.expect(const$231/*const SourceString(">")*/, token);
}
Parser.prototype.expect = function(string, token) {
- if ($ne(string, token.get$value())) {
+ if ($notnull_bool($ne(string, token.get$value()))) {
return this.listener.expected(string, token);
}
return token.next;
@@ -4853,15 +4971,15 @@ Parser.prototype.optional = function(value, token) {
return $eq(value, token.get$value());
}
Parser.prototype.parseSuperclassClauseOpt = function(token) {
- if (this.optional(const$193/*Keyword.EXTENDS*/, token)) {
+ if ($notnull_bool(this.optional(const$193/*Keyword.EXTENDS*/, token))) {
return this.parseType(this.next(token));
}
return token;
}
Parser.prototype.parseType = function(token) {
- if (this.isIdentifier(token)) {
+ if ($notnull_bool(this.isIdentifier(token))) {
token = this.parseIdentifier(token);
- while (this.optional(const$229/*const SourceString(".")*/, token)) {
+ while ($notnull_bool(this.optional(const$229/*const SourceString(".")*/, token))) {
token = this.parseIdentifier(this.next(token));
}
}
@@ -4871,22 +4989,22 @@ Parser.prototype.parseType = function(token) {
return this.parseTypeArgumentsOpt(token);
}
Parser.prototype.parseTypeArgumentsOpt = function(token) {
- if (this.optional(const$228/*const SourceString("<")*/, token)) {
+ if ($notnull_bool(this.optional(const$228/*const SourceString("<")*/, token))) {
this.listener.beginTypeArguments(this.next(token));
do {
token = this.parseType(this.next(token));
}
- while (this.optional(const$230/*const SourceString(",")*/, token))
+ while ($notnull_bool(this.optional(const$230/*const SourceString(",")*/, token)))
return this.expect(const$231/*const SourceString(">")*/, token);
}
return token;
}
Parser.prototype.parseImplementsOpt = function(token) {
- if (this.optional(const$199/*Keyword.IMPLEMENTS*/, token)) {
+ if ($notnull_bool(this.optional(const$199/*Keyword.IMPLEMENTS*/, token))) {
do {
token = this.parseType(this.next(token));
}
- while (this.optional(const$230/*const SourceString(",")*/, token))
+ while ($notnull_bool(this.optional(const$230/*const SourceString(",")*/, token)))
}
return token;
}
@@ -4900,7 +5018,7 @@ Parser.prototype.parseTopLevelMember = function(token) {
this.listener.beginTopLevelMember(token);
var previous = token;
LOOP:
- while (token != null) {
+ while ($notnull_bool(token != null)) {
switch (token.kind) {
case 123/*null.LBRACE_TOKEN*/:
case 59/*null.SEMICOLON_TOKEN*/:
@@ -4918,19 +5036,19 @@ Parser.prototype.parseTopLevelMember = function(token) {
}
}
token = this.parseIdentifier(previous);
- if (this.optional(const$234/*const SourceString("(")*/, token)) {
+ if ($notnull_bool(this.optional(const$234/*const SourceString("(")*/, token))) {
this.listener.topLevelMethod(start);
}
- else if (this.optional(const$238/*const SourceString("=")*/, token) || this.optional(const$236/*const SourceString(";")*/, token)) {
+ else if ($notnull_bool(this.optional(const$238/*const SourceString("=")*/, token) || this.optional(const$236/*const SourceString(";")*/, token))) {
this.listener.topLevelField(start);
}
else {
token = this.listener.unexpected(token);
}
- while (token != null && token.kind != 123/*null.LBRACE_TOKEN*/ && token.kind != 59/*null.SEMICOLON_TOKEN*/) {
+ while ($notnull_bool(token != null && token.kind != 123/*null.LBRACE_TOKEN*/ && token.kind != 59/*null.SEMICOLON_TOKEN*/)) {
token = this.next(token);
}
- if (!this.optional(const$236/*const SourceString(";")*/, token)) {
+ if ($notnull_bool(!this.optional(const$236/*const SourceString(";")*/, token))) {
token = this.skipBlock(token);
}
this.listener.endTopLevelMember(token);
@@ -4940,7 +5058,7 @@ Parser.prototype.parseLibraryTags = function(token) {
this.listener.beginLibraryTag(token);
token = this.parseIdentifier(this.next(token));
token = this.expect(const$234/*const SourceString("(")*/, token);
- while (token != null && token.kind != 40/*null.LPAREN_TOKEN*/ && token.kind != 41/*null.RPAREN_TOKEN*/) {
+ while ($notnull_bool(token != null && token.kind != 40/*null.LPAREN_TOKEN*/ && token.kind != 41/*null.RPAREN_TOKEN*/)) {
token = this.next(token);
}
token = this.expect(const$235/*const SourceString(")")*/, token);
@@ -4966,7 +5084,7 @@ BodyParser.prototype.parseFormalParameters = function(token) {
this.listener.beginFormalParameters(begin);
this.expect(const$234/*const SourceString("(")*/, token);
var parameterCount = 0;
- if (this.optional(const$235/*const SourceString(")")*/, token.next)) {
+ if ($notnull_bool(this.optional(const$235/*const SourceString(")")*/, token.next))) {
this.listener.endFormalParameters(parameterCount, begin, token.next);
return token.next.next;
}
@@ -4975,12 +5093,12 @@ BodyParser.prototype.parseFormalParameters = function(token) {
token = this.parseIdentifier(token);
++parameterCount;
}
- while (this.optional(const$230/*const SourceString(",")*/, token))
+ while ($notnull_bool(this.optional(const$230/*const SourceString(",")*/, token)))
this.listener.endFormalParameters(parameterCount, begin, token);
return this.expect(const$235/*const SourceString(")")*/, token);
}
BodyParser.prototype.parseFunctionBody = function(token) {
- if (this.optional(const$236/*const SourceString(";")*/, token)) {
+ if ($notnull_bool(this.optional(const$236/*const SourceString(";")*/, token))) {
this.listener.endFunctionBody(0, null, token);
return token.next;
}
@@ -4988,7 +5106,7 @@ BodyParser.prototype.parseFunctionBody = function(token) {
var statementCount = 0;
this.listener.beginFunctionBody(begin);
token = this.checkEof(this.expect(const$232/*const SourceString("{")*/, token));
- while (!this.optional(const$239/*const SourceString("}")*/, token)) {
+ while ($notnull_bool(!this.optional(const$239/*const SourceString("}")*/, token))) {
token = this.parseStatement(token);
++statementCount;
}
@@ -4997,7 +5115,7 @@ BodyParser.prototype.parseFunctionBody = function(token) {
}
BodyParser.prototype.parseStatement = function(token) {
this.checkEof(token);
- if ($eq(token.get$value(), const$240/*const SourceString('{')*/)) {
+ if ($notnull_bool($eq(token.get$value(), const$240/*const SourceString('{')*/))) {
return this.parseBlock(token);
}
switch (token.get$value()) {
@@ -5025,6 +5143,7 @@ BodyParser.prototype.expectSemicolon = function(token) {
BodyParser.prototype.parseReturnStatement = function(token) {
var begin = token;
this.listener.beginReturnStatement(begin);
+ $assert($eq(const$241/*const SourceString("return")*/, token.get$value()), "const SourceString(\"return\") == token.value", "leg/scanner/parser.dart", 393, 12);
token = this.parseExpression(this.next(token));
this.listener.endReturnStatement(true, begin, token);
return this.expectSemicolon(token);
@@ -5037,7 +5156,7 @@ BodyParser.prototype.parseExpressionStatement = function(token) {
}
BodyParser.prototype.parseExpression = function(token) {
token = this.parseConditionalExpression(token);
- if (this.isAssignmentOperator(token)) {
+ if ($notnull_bool(this.isAssignmentOperator(token))) {
var operator = token;
token = this.parseExpression(this.next(token));
this.listener.handleAssignmentExpression(operator);
@@ -5049,7 +5168,7 @@ BodyParser.prototype.isAssignmentOperator = function(token) {
}
BodyParser.prototype.parseConditionalExpression = function(token) {
token = this.parseBinaryExpression(token, 4);
- if (this.optional(const$242/*const SourceString("?")*/, token)) {
+ if ($notnull_bool(this.optional(const$242/*const SourceString("?")*/, token))) {
var question = token;
token = this.parseExpression(this.next(token));
var colon = token;
@@ -5060,10 +5179,11 @@ BodyParser.prototype.parseConditionalExpression = function(token) {
return token;
}
BodyParser.prototype.parseBinaryExpression = function(token, precedence) {
+ $assert(precedence >= 4, "precedence >= 4", "leg/scanner/parser.dart", 434, 12);
token = this.parsePrimary(token);
for (var level = this.getPrecedence(token);
- level >= precedence; --level) {
- while (this.getPrecedence(token) == level) {
+ $notnull_bool(level >= precedence); --level) {
+ while ($notnull_bool(this.getPrecedence(token) == level)) {
var operator = token;
token = this.parseBinaryExpression(this.next(token), level + 1);
this.listener.handleBinaryExpression(operator);
@@ -5072,9 +5192,9 @@ BodyParser.prototype.parseBinaryExpression = function(token, precedence) {
return token;
}
BodyParser.prototype.getPrecedence = function(token) {
- if (token == null) return 0;
+ if ($notnull_bool(token == null)) return 0;
var value = token.get$value();
- if (!(value instanceof StringWrapper)) return 0;
+ if ($notnull_bool(!(value instanceof StringWrapper))) return 0;
switch (value.toString()) {
case "%=":
@@ -5297,7 +5417,7 @@ BodyParser.prototype.parseSend = function(token) {
return token;
}
BodyParser.prototype.parseArgumentsOpt = function(token) {
- if (!this.optional(const$234/*const SourceString("(")*/, token)) {
+ if ($notnull_bool(!this.optional(const$234/*const SourceString("(")*/, token))) {
this.listener.handleNoArgumentsOpt(token);
return token;
}
@@ -5306,8 +5426,9 @@ BodyParser.prototype.parseArgumentsOpt = function(token) {
BodyParser.prototype.parseArguments = function(token) {
var begin = token;
this.listener.beginArguments(begin);
+ $assert($eq(const$234/*const SourceString("(")*/, token.get$value()), "const SourceString(\"(\") == token.value", "leg/scanner/parser.dart", 559, 12);
var argumentCount = 0;
- if (this.optional(const$235/*const SourceString(")")*/, token.next)) {
+ if ($notnull_bool(this.optional(const$235/*const SourceString(")")*/, token.next))) {
this.listener.endArguments(argumentCount, begin, token.next);
return token.next.next;
}
@@ -5315,7 +5436,7 @@ BodyParser.prototype.parseArguments = function(token) {
token = this.parseExpression(this.next(token));
++argumentCount;
}
- while (this.optional(const$230/*const SourceString(",")*/, token))
+ while ($notnull_bool(this.optional(const$230/*const SourceString(",")*/, token)))
this.listener.endArguments(argumentCount, begin, token);
return this.expect(const$235/*const SourceString(")")*/, token);
}
@@ -5324,7 +5445,7 @@ BodyParser.prototype.parseVariablesDeclaration = function(token) {
this.listener.beginVariablesDeclaration(token);
token = this.parseFinalVarOrType(token);
token = this.parseOptionallyInitializedIdentifier(token);
- while (this.optional(const$245/*const SourceString(',')*/, token)) {
+ while ($notnull_bool(this.optional(const$245/*const SourceString(',')*/, token))) {
token = this.parseOptionallyInitializedIdentifier(this.next(token));
++count;
}
@@ -5334,7 +5455,7 @@ BodyParser.prototype.parseVariablesDeclaration = function(token) {
BodyParser.prototype.parseOptionallyInitializedIdentifier = function(token) {
this.listener.beginInitializedIdentifier(token);
token = this.parseIdentifier(token);
- if (this.optional(const$244/*const SourceString('=')*/, token)) {
+ if ($notnull_bool(this.optional(const$244/*const SourceString('=')*/, token))) {
var assignment = token;
this.listener.beginInitializer(token);
token = this.parseExpression(this.next(token));
@@ -5355,7 +5476,7 @@ BodyParser.prototype.parseIfStatement = function(token) {
token = this.parseArguments(token);
token = this.parseStatement(token);
var elseToken = null;
- if (this.optional(const$147/*Keyword.ELSE*/, token)) {
+ if ($notnull_bool(this.optional(const$147/*Keyword.ELSE*/, token))) {
elseToken = token;
token = this.parseStatement(token.next);
}
@@ -5367,7 +5488,7 @@ BodyParser.prototype.parseBlock = function(token) {
this.listener.beginBlock(begin);
var statementCount = 0;
token = this.expect(const$240/*const SourceString('{')*/, token);
- while (!this.optional(const$239/*const SourceString("}")*/, token)) {
+ while ($notnull_bool(!this.optional(const$239/*const SourceString("}")*/, token))) {
token = this.parseStatement(token);
++statementCount;
}
@@ -5490,14 +5611,17 @@ Listener.prototype.unexpected = function(token) {
this.canceler.cancel(("Unexpected token '" + token + "' @ " + token.charOffset + ""));
}
Listener.prototype.push = function(token, builder) {
- this.builders = this.builders.prepend(new DeclarationBuilder(token, builder));
+ var $0;
+ this.builders = (($0 = this.builders.prepend(new DeclarationBuilder(token, builder))) && $0.is$Link$DeclarationBuilder());
}
Listener.prototype.addElement = function(element) {
- this.topLevelElements = this.topLevelElements.prepend(element);
+ var $0;
+ this.topLevelElements = (($0 = this.topLevelElements.prepend(element)) && $0.is$Link$Element());
}
Listener.prototype.pop = function() {
+ var $0;
var declaration = this.builders.get$head();
- this.builders = this.builders.get$tail();
+ this.builders = (($0 = this.builders.get$tail()) && $0.is$Link$DeclarationBuilder());
return declaration;
}
Listener.prototype.handleDeclaration = function(declaration, token) {
@@ -5546,7 +5670,7 @@ BodyListener.prototype.beginReturnStatement = function(token) {
}
BodyListener.prototype.endReturnStatement = function(hasExpression, beginToken, endToken) {
- var expression = hasExpression ? this.popNode() : null;
+ var expression = $notnull_bool(hasExpression) ? this.popNode() : null;
this.pushNode(new Return(beginToken, endToken, expression));
}
BodyListener.prototype.beginExpressionStatement = function(token) {
@@ -5580,10 +5704,10 @@ BodyListener.prototype.handleBinaryExpression = function(token) {
BodyListener.prototype.handleAssignmentExpression = function(token) {
var arguments = new NodeList.singleton$ctor(this.popNode());
var node = this.popNode();
- if (!(node instanceof Send)) this.canceler.cancel(('not assignable: ' + node + ''));
+ if ($notnull_bool(!(node instanceof Send))) this.canceler.cancel(('not assignable: ' + node + ''));
var send = node;
- if (!send.get$isPropertyAccess()) this.canceler.cancel(('not assignable: ' + node + ''));
- if ((send instanceof SetterSend)) this.canceler.cancel('chained assignment');
+ if ($notnull_bool(!send.get$isPropertyAccess())) this.canceler.cancel(('not assignable: ' + node + ''));
+ if ($notnull_bool((send instanceof SetterSend))) this.canceler.cancel('chained assignment');
this.pushNode(new SetterSend(send.receiver, send.selector, token, arguments));
}
BodyListener.prototype.handleConditionalExpression = function(question, colon) {
@@ -5619,10 +5743,11 @@ BodyListener.prototype.beginFunctionBody = function(token) {
}
BodyListener.prototype.endFunctionBody = function(count, beginToken, endToken) {
+ var $0;
var block = new Block(this.makeNodeList(count, beginToken, endToken, null));
var formals = this.popNode();
var name = this.popNode();
- var type = new TypeAnnotation(this.popNode());
+ var type = new TypeAnnotation((($0 = this.popNode()) && $0.is$Identifier()));
this.pushNode(new FunctionExpression(name, formals, block, type));
}
BodyListener.prototype.beginVariablesDeclaration = function(token) {
@@ -5655,7 +5780,7 @@ BodyListener.prototype.beginIfStatement = function(token) {
}
BodyListener.prototype.endIfStatement = function(ifToken, elseToken) {
- var elsePart = (elseToken == null) ? null : this.popNode();
+ var elsePart = $notnull_bool((elseToken == null)) ? null : this.popNode();
var thenPart = this.popNode();
var condition = this.popNode();
this.pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken));
@@ -5667,21 +5792,25 @@ BodyListener.prototype.endBlock = function(count, beginToken, endToken) {
this.pushNode(new Block(this.makeNodeList(count, beginToken, endToken, null)));
}
BodyListener.prototype.pushNode = function(node) {
- this.nodes = this.nodes.prepend(node);
+ var $0;
+ this.nodes = (($0 = this.nodes.prepend(node)) && $0.is$Link$Node());
this.logger.log(("push " + this.nodes + ""));
}
BodyListener.prototype.popNode = function() {
+ var $0;
+ $assert(!this.nodes.isEmpty(), "!nodes.isEmpty()", "leg/scanner/listener.dart", 360, 12);
var node = this.nodes.get$head();
- this.nodes = this.nodes.get$tail();
+ this.nodes = (($0 = this.nodes.get$tail()) && $0.is$Link$Node());
this.logger.log(("pop " + this.nodes + ""));
return node;
}
BodyListener.prototype.makeNodeList = function(count, beginToken, endToken, delimiter) {
+ var $0;
var nodes0 = const$227/*const EmptyLink<DeclarationBuilder>()*/;
- for (; count > 0; --count) {
- nodes0 = nodes0.prepend(this.popNode());
+ for (; $notnull_bool(count > 0); --count) {
+ nodes0 = (($0 = nodes0.prepend(this.popNode())) && $0.is$Link$Node());
}
- var sourceDelimiter = (delimiter == null) ? null : new StringWrapper(delimiter);
+ var sourceDelimiter = $notnull_bool((delimiter == null)) ? null : new StringWrapper(delimiter);
return new NodeList(beginToken, nodes0, endToken, sourceDelimiter);
}
// ********** Code for PartialFunctionElement **************
@@ -5693,10 +5822,11 @@ function PartialFunctionElement(name0, beginToken, endToken) {
}
$inherits(PartialFunctionElement, FunctionElement);
PartialFunctionElement.prototype.parseNode = function(canceler, logger) {
- if (this.node != null) return this.node;
+ var $0;
+ if ($notnull_bool(this.node != null)) return this.node;
var listener = new BodyListener(canceler, logger);
new BodyParser(listener).parseFunction(this.beginToken);
- this.node = listener.popNode();
+ this.node = (($0 = listener.popNode()) && $0.is$FunctionExpression());
logger.log(("parsed function: " + this.node + ""));
return this.node;
}
@@ -5714,7 +5844,7 @@ StringScanner.prototype.peek = function() {
return this.charAt(this.byteOffset + 1);
}
StringScanner.prototype.charAt = function(index) {
- return (this.string.length > index) ? this.string.charCodeAt(index) : -1;
+ return $notnull_bool((this.string.length > $assert_num(index))) ? this.string.charCodeAt(index) : -1;
}
StringScanner.prototype.asciiString = function(start) {
return this.string.substring(start, this.byteOffset);
@@ -5779,21 +5909,26 @@ StringWrapper.prototype.printOn = function(sb) {
StringWrapper.prototype.toString = function() {
return this.internalString;
}
-StringWrapper.prototype.printOn$1 = StringWrapper.prototype.printOn;
+StringWrapper.prototype.printOn$1 = function($0) {
+ return this.printOn(($0 && $0.is$StringBuffer()));
+}
+;
// ********** Code for Keyword **************
function Keyword(syntax, isPseudo) {
this.syntax = syntax;
this.isPseudo = isPseudo;
// Initializers done
}
+Keyword.prototype.is$Keyword = function(){return this;};
Keyword.prototype.is$SourceString = function(){return this;};
Keyword.get$keywords = function() {
- if (Keyword._keywords == null) {
+ if ($notnull_bool(Keyword._keywords == null)) {
Keyword._keywords = Keyword.computeKeywordMap();
}
return Keyword._keywords;
}
Keyword.computeKeywordMap = function() {
+ var $0;
var result = new LinkedHashMapImplementation$String$Keyword();
for (var $i0 = const$222/*Keyword.values*/.iterator(); $i0.hasNext(); ) {
var keyword = $i0.next();
@@ -5813,14 +5948,17 @@ Keyword.prototype.printOn = function(sb) {
Keyword.prototype.toString = function() {
return this.syntax;
}
-Keyword.prototype.printOn$1 = Keyword.prototype.printOn;
+Keyword.prototype.printOn$1 = function($0) {
+ return this.printOn(($0 && $0.is$StringBuffer()));
+}
+;
// ********** Code for KeywordState **************
function KeywordState() {}
KeywordState.get$KEYWORD_STATE = function() {
- if (KeywordState._KEYWORD_STATE == null) {
+ if ($notnull_bool(KeywordState._KEYWORD_STATE == null)) {
var strings = new ListFactory$String(const$222/*Keyword.values*/.get$length());
for (var i = 0;
- i < const$222/*Keyword.values*/.get$length(); i++) {
+ $notnull_bool(i < const$222/*Keyword.values*/.get$length()); i++) {
strings.$setindex(i, const$222/*Keyword.values*/[i].syntax);
}
strings.sort((function (a, b) {
@@ -5833,14 +5971,15 @@ KeywordState.get$KEYWORD_STATE = function() {
}
KeywordState.computeKeywordStateTable = function(start, strings, offset, length) {
var result = new ListFactory$KeywordState(26);
+ $assert(length != 0, "length != 0", "leg/scanner/keyword.dart", 160, 12);
var chunk = 0;
var chunkStart = -1;
for (var i = offset;
- i < offset + length; i++) {
- if (strings.$index(i).length > start) {
+ $notnull_bool(i < offset + length); i++) {
+ if ($notnull_bool(strings.$index(i).length > start)) {
var c = strings.$index(i).charCodeAt(start);
- if (chunk != c) {
- if (chunkStart != -1) {
+ if ($notnull_bool(chunk != c)) {
+ if ($notnull_bool(chunkStart != -1)) {
result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordStateTable(start + 1, strings, chunkStart, i - chunkStart));
}
chunkStart = i;
@@ -5848,11 +5987,12 @@ KeywordState.computeKeywordStateTable = function(start, strings, offset, length)
}
}
}
- if (chunkStart != -1) {
+ if ($notnull_bool(chunkStart != -1)) {
result.$setindex(chunk - 97/*null.$a*/, KeywordState.computeKeywordStateTable(start + 1, strings, chunkStart, offset + length - chunkStart));
}
else {
- return new LeafKeywordState(strings.$index(offset));
+ $assert(length == 1, "length == 1", "leg/scanner/keyword.dart", 182, 14);
+ return new LeafKeywordState($assert_String(strings.$index(offset)));
}
return new ArrayKeywordState(result);
}
@@ -5876,8 +6016,8 @@ ArrayKeywordState.prototype.toString = function() {
sb.add("[");
var foo = this.table;
for (var i = 0;
- i < foo.length; i++) {
- if ($ne(foo.$index(i), null)) {
+ $notnull_bool(i < foo.length); i++) {
+ if ($notnull_bool($ne(foo.$index(i), null))) {
sb.add(("" + (i + 97/*null.$a*/) + ": " + foo.$index(i) + "; "));
}
}
@@ -5886,7 +6026,8 @@ ArrayKeywordState.prototype.toString = function() {
}
// ********** Code for LeafKeywordState **************
function LeafKeywordState(syntax) {
- this.keyword = Keyword.get$keywords().$index(syntax);
+ var $0;
+ this.keyword = (($0 = Keyword.get$keywords().$index(syntax)) && $0.is$Keyword());
// Initializers done
}
$inherits(LeafKeywordState, KeywordState);
@@ -5905,6 +6046,7 @@ LeafKeywordState.prototype.toString = function() {
// ********** Library tree **************
// ********** Code for Node **************
function Node() {}
+Node.prototype.is$Node = function(){return this;};
Node.prototype.hashCode = function() {
return this._hashCode;
}
@@ -5948,8 +6090,8 @@ Send.prototype.getBeginToken = function() {
}
Send.prototype.getEndToken = function() {
var token = this.argumentsNode.getEndToken();
- if (token != null) return token;
- if (this.selector != null) {
+ if ($notnull_bool(token != null)) return token;
+ if ($notnull_bool(this.selector != null)) {
return this.selector.getEndToken();
}
return this.receiver.getBeginToken();
@@ -5982,14 +6124,15 @@ NodeList.prototype.accept = function(visitor) {
return visitor.visitNodeList(this);
}
NodeList.prototype.getBeginToken = function() {
- if (this.beginToken != null) return this.beginToken;
- if (this.nodes != null) {
+ var $0;
+ if ($notnull_bool(this.beginToken != null)) return this.beginToken;
+ if ($notnull_bool(this.nodes != null)) {
for (var link = this.nodes;
- !link.isEmpty(); link = link.get$tail()) {
- if (link.get$head().getBeginToken() != null) {
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$Node())) {
+ if ($notnull_bool(link.get$head().getBeginToken() != null)) {
return link.get$head().getBeginToken();
}
- if (link.get$head().getEndToken() != null) {
+ if ($notnull_bool(link.get$head().getEndToken() != null)) {
return link.get$head().getEndToken();
}
}
@@ -5997,12 +6140,13 @@ NodeList.prototype.getBeginToken = function() {
return this.endToken;
}
NodeList.prototype.getEndToken = function() {
- if (this.endToken != null) return this.endToken;
- if (this.nodes != null) {
+ var $0;
+ if ($notnull_bool(this.endToken != null)) return this.endToken;
+ if ($notnull_bool(this.nodes != null)) {
var link = this.nodes;
- while (!link.get$tail().isEmpty()) link = link.get$tail();
- if (link.get$head().getEndToken() != null) return link.get$head().getEndToken();
- if (link.get$head().getBeginToken() != null) return link.get$head().getBeginToken();
+ while ($notnull_bool(!link.get$tail().isEmpty())) link = (($0 = link.get$tail()) && $0.is$Link$Node());
+ if ($notnull_bool(link.get$head().getEndToken() != null)) return link.get$head().getEndToken();
+ if ($notnull_bool(link.get$head().getBeginToken() != null)) return link.get$head().getBeginToken();
}
return this.beginToken;
}
@@ -6041,7 +6185,7 @@ If.prototype.getBeginToken = function() {
return this.ifToken;
}
If.prototype.getEndToken = function() {
- if (this.elsePart == null) return this.thenPart.getEndToken();
+ if ($notnull_bool(this.elsePart == null)) return this.thenPart.getEndToken();
return this.elsePart.getEndToken();
}
// ********** Code for FunctionExpression **************
@@ -6053,6 +6197,7 @@ function FunctionExpression(name, parameters, body, returnType) {
// Initializers done
}
$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$returnType = function() { return this.returnType; };
@@ -6120,7 +6265,7 @@ function LiteralInt(token0, handler0) {
$inherits(LiteralInt, Literal$int);
LiteralInt.prototype.get$value = function() {
try {
- return Math.parseInt(this.token.get$value().toString());
+ return Math.parseInt($assert_String(this.token.get$value().toString()));
} catch (ex) {
ex = $toDartException(ex);
if (!(ex instanceof BadNumberFormatException)) throw ex;
@@ -6144,7 +6289,7 @@ function LiteralDouble(token0, handler0) {
$inherits(LiteralDouble, Literal$double);
LiteralDouble.prototype.get$value = function() {
try {
- return Math.parseDouble(this.token.get$value().toString());
+ return Math.parseDouble($assert_String(this.token.get$value().toString()));
} catch (ex) {
ex = $toDartException(ex);
if (!(ex instanceof BadNumberFormatException)) throw ex;
@@ -6197,6 +6342,7 @@ function Identifier(token) {
// Initializers done
}
$inherits(Identifier, Expression);
+Identifier.prototype.is$Identifier = function(){return this;};
Identifier.prototype.get$source = function() {
return this.token.get$value();
}
@@ -6310,8 +6456,8 @@ DebugUnparser.prototype.unparse = function(node) {
}
DebugUnparser.prototype.visit = function(node, withSeparator) {
var previous = this.separator;
- this.separator = (withSeparator != null) ? withSeparator : this.separator;
- if (node != null) node.accept(this);
+ this.separator = $assert_String($notnull_bool((withSeparator != null)) ? withSeparator : this.separator);
+ if ($notnull_bool(node != null)) node.accept(this);
this.separator = previous;
}
DebugUnparser.prototype.visitBlock = function(node) {
@@ -6322,7 +6468,7 @@ DebugUnparser.prototype.visitExpressionStatement = function(node) {
this.sb.add(';');
}
DebugUnparser.prototype.visitFunctionExpression = function(node) {
- if (node.returnType != null) {
+ if ($notnull_bool(node.returnType != null)) {
this.visit(node.returnType);
this.sb.add(' ');
}
@@ -6337,7 +6483,7 @@ DebugUnparser.prototype.visitIf = function(node) {
node.ifToken.get$value().printOn$1(this.sb);
this.visit(node.condition);
this.visit(node.thenPart);
- if (node.get$hasElsePart()) {
+ if ($notnull_bool(node.get$hasElsePart())) {
node.elseToken.get$value().printOn$1(this.sb);
this.visit(node.elsePart);
}
@@ -6355,26 +6501,27 @@ DebugUnparser.prototype.visitLiteralString = function(node) {
node.token.get$value().printOn$1(this.sb);
}
DebugUnparser.prototype.visitNodeList = function(node) {
+ var $0;
var first = true;
- if (node.beginToken != null) this.sb.add(node.beginToken);
- if (node.nodes != null) {
+ if ($notnull_bool(node.beginToken != null)) this.sb.add(node.beginToken);
+ if ($notnull_bool(node.nodes != null)) {
var delimiter = node.delimiter;
- if (delimiter == null) delimiter = new StringWrapper(this.separator);
+ if ($notnull_bool(delimiter == null)) delimiter = new StringWrapper(this.separator);
var $list = node.nodes;
for (var $i = node.nodes.iterator(); $i.hasNext(); ) {
var element = $i.next();
- if (!first) delimiter.printOn(this.sb);
+ if ($notnull_bool(!first)) delimiter.printOn(this.sb);
first = false;
this.visit(element);
}
}
- if (node.endToken != null) this.sb.add(node.endToken);
+ if ($notnull_bool(node.endToken != null)) this.sb.add(node.endToken);
}
DebugUnparser.prototype.visitOperator = function(node) {
this.visitIdentifier(node);
}
DebugUnparser.prototype.visitParameter = function(node) {
- if (node.typeAnnotation != null) {
+ if ($notnull_bool(node.typeAnnotation != null)) {
this.visit(node.typeAnnotation);
this.sb.add(' ');
}
@@ -6382,22 +6529,22 @@ DebugUnparser.prototype.visitParameter = function(node) {
}
DebugUnparser.prototype.visitReturn = function(node) {
node.beginToken.get$value().printOn$1(this.sb);
- if (node.get$hasExpression()) {
+ if ($notnull_bool(node.get$hasExpression())) {
this.sb.add(' ');
this.visit(node.expression);
}
node.endToken.get$value().printOn$1(this.sb);
}
DebugUnparser.prototype.visitSend = function(node) {
- if (node.receiver != null) {
+ if ($notnull_bool(node.receiver != null)) {
this.visit(node.receiver);
- if (!(node.selector instanceof Operator)) this.sb.add('.');
+ if ($notnull_bool(!(node.selector instanceof Operator))) this.sb.add('.');
}
this.visit(node.selector);
this.visit(node.argumentsNode, ', ');
}
DebugUnparser.prototype.visitSetterSend = function(node) {
- if (node.receiver != null) {
+ if ($notnull_bool(node.receiver != null)) {
this.visit(node.receiver);
this.sb.add('.');
}
@@ -6409,7 +6556,7 @@ DebugUnparser.prototype.visitTypeAnnotation = function(node) {
this.visit(node.typeName);
}
DebugUnparser.prototype.visitVariableDefinitions = function(node) {
- if (node.type != null) {
+ if ($notnull_bool(node.type != null)) {
this.visit(node.type);
this.sb.add(' ');
}
@@ -6418,7 +6565,7 @@ DebugUnparser.prototype.visitVariableDefinitions = function(node) {
}
// ********** Code for top level **************
function firstBeginToken(first, second) {
- return (first != null) ? first.getBeginToken() : second.getBeginToken();
+ return $notnull_bool((first != null)) ? first.getBeginToken() : second.getBeginToken();
}
// ********** Library elements **************
// ********** Code for Element **************
@@ -6427,6 +6574,7 @@ function Element(name, enclosingElement) {
this.enclosingElement = enclosingElement;
// Initializers done
}
+Element.prototype.is$Element = function(){return this;};
Element.prototype.get$name = function() { return this.name; };
Element.prototype.hashCode = function() {
return this.name.hashCode();
@@ -6438,32 +6586,33 @@ function FunctionElement(name0) {
}
$inherits(FunctionElement, Element);
FunctionElement.prototype.computeType = function(compiler, types) {
- if (this.type != null) return this.type;
+ var $0;
+ if ($notnull_bool(this.type != null)) return this.type;
var node = this.parseNode(compiler, compiler);
var returnType = getType(node.returnType, types);
var parameterTypes = new LinkBuilderImplementation$Type();
for (var link = node.parameters.nodes;
- !link.isEmpty(); link = link.get$tail()) {
+ $notnull_bool(!link.isEmpty()); link = link.get$tail()) {
compiler.cancel('parameters not supported.');
var parameter = link.get$head();
parameterTypes.addLast(getType(parameter.typeAnnotation, types));
}
- this.type = new FunctionType(returnType, parameterTypes.toLink());
+ this.type = new FunctionType(returnType, (($0 = parameterTypes.toLink()) && $0.is$Link$Type()));
return this.type;
}
// ********** Code for top level **************
function getType(annotation, types) {
- if (annotation == null || annotation.typeName == null) {
+ if ($notnull_bool(annotation == null || annotation.typeName == null)) {
return types.DYNAMIC;
}
var name = annotation.typeName.get$source();
- if ($eq(name, types.VOID.get$name())) {
+ if ($notnull_bool($eq(name, types.VOID.get$name()))) {
return types.VOID;
}
- else if ($eq(name, types.INT.get$name())) {
+ else if ($notnull_bool($eq(name, types.INT.get$name()))) {
return types.INT;
}
- else if ($eq(name, types.STRING.get$name())) {
+ else if ($notnull_bool($eq(name, types.STRING.get$name()))) {
return types.STRING;
}
else {
@@ -6485,7 +6634,8 @@ SsaBuilderTask.prototype.build = function(tree) {
return this.measure((function () {
var function_ = tree;
var graph = $this.compileMethod(function_.body);
- if (false/*null.GENERATE_SSA_TRACE*/) {
+ $assert(graph.isValid(), "graph.isValid()", "leg/ssa/builder.dart", 13, 14);
+ if ($notnull_bool(false/*null.GENERATE_SSA_TRACE*/)) {
var name0 = tree.get$name();
HTracer.HTracer$singleton$factory().traceCompilation(name0.get$source().toString());
HTracer.HTracer$singleton$factory().traceGraph('builder', graph);
@@ -6509,7 +6659,7 @@ SsaBuilder.prototype.build = function(body) {
this.block = new HBasicBlock();
this.stack = new ListFactory$HInstruction();
body.accept(this);
- if (this.block.last == null || !(this.block.last instanceof HReturn)) {
+ if ($notnull_bool(this.block.last == null || !(this.block.last instanceof HReturn))) {
this.block.add(new HGoto());
this.graph.setSuccessors(this.block, [this.graph.exit]);
}
@@ -6528,11 +6678,11 @@ SsaBuilder.prototype.pop = function() {
return this.stack.removeLast();
}
SsaBuilder.prototype.visit = function(node) {
- if (node != null) node.accept(this);
+ if ($notnull_bool(node != null)) node.accept(this);
}
SsaBuilder.prototype.visitBlock = function(node) {
this.visit(node.statements);
- if (!this.stack.isEmpty()) this.compiler.cancel('non-empty instruction stack');
+ if ($notnull_bool(!this.stack.isEmpty())) this.compiler.cancel('non-empty instruction stack');
}
SsaBuilder.prototype.visitExpressionStatement = function(node) {
this.visit(node.expression);
@@ -6548,25 +6698,26 @@ SsaBuilder.prototype.visitIf = function(node) {
this.compiler.cancel("ssa/builder.dart: visitIf not implemented");
}
SsaBuilder.prototype.visitSend = function(node) {
- if ((node.selector instanceof Operator)) {
+ var $0;
+ if ($notnull_bool((node.selector instanceof Operator))) {
this.visit(node.receiver);
this.visit(node.argumentsNode);
var right = this.pop();
var left = this.pop();
var op = node.selector;
- if ($eq(const$258/*const SourceString("+")*/, op.get$source())) {
+ if ($notnull_bool($eq(const$258/*const SourceString("+")*/, op.get$source()))) {
this.push(new HAdd([left, right]));
}
- else if ($eq(const$259/*const SourceString("-")*/, op.get$source())) {
+ else if ($notnull_bool($eq(const$259/*const SourceString("-")*/, op.get$source()))) {
this.push(new HSubtract([left, right]));
}
- else if ($eq(const$260/*const SourceString("*")*/, op.get$source())) {
+ else if ($notnull_bool($eq(const$260/*const SourceString("*")*/, op.get$source()))) {
this.push(new HMultiply([left, right]));
}
- else if ($eq(const$261/*const SourceString("/")*/, op.get$source())) {
+ else if ($notnull_bool($eq(const$261/*const SourceString("/")*/, op.get$source()))) {
this.push(new HDivide([left, right]));
}
- else if ($eq(const$262/*const SourceString("~/")*/, op.get$source())) {
+ else if ($notnull_bool($eq(const$262/*const SourceString("~/")*/, op.get$source()))) {
this.push(new HTruncatingDivide([left, right]));
}
}
@@ -6574,7 +6725,7 @@ SsaBuilder.prototype.visitSend = function(node) {
this.visit(node.argumentsNode);
var arguments = [];
for (var link = node.get$arguments();
- !link.isEmpty(); link = link.get$tail()) {
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$Node())) {
arguments.add(this.pop());
}
var selector = node.selector;
@@ -6594,9 +6745,10 @@ SsaBuilder.prototype.visitLiteralString = function(node) {
this.push(new HLiteral(node.get$value()));
}
SsaBuilder.prototype.visitNodeList = function(node) {
+ var $0;
for (var link = node.nodes;
- !link.isEmpty(); link = link.get$tail()) {
- this.visit(link.get$head());
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$Node())) {
+ this.visit((($0 = link.get$head()) && $0.is$Node()));
}
}
SsaBuilder.prototype.visitOperator = function(node) {
@@ -6631,7 +6783,7 @@ SsaCodeGeneratorTask.prototype.generate = function(tree, graph) {
return this.measure((function () {
var function_ = tree;
var name0 = function_.name;
- if (false/*null.GENERATE_SSA_TRACE*/) {
+ if ($notnull_bool(false/*null.GENERATE_SSA_TRACE*/)) {
HTracer.HTracer$singleton$factory().traceGraph("codegen", graph);
}
var code = $this.generateMethod(name0.get$source(), graph);
@@ -6655,9 +6807,11 @@ function SsaCodeGenerator(compiler, buffer) {
SsaCodeGenerator.prototype.visitGraph = function(graph) {
var $this = this; // closure support
function visitBasicBlockAndSuccessors(block) {
+ var $0;
$this.visit(block);
- if (!block.successors.isEmpty()) {
- visitBasicBlockAndSuccessors(block.successors.$index(0));
+ if ($notnull_bool(!block.successors.isEmpty())) {
+ $assert(block.successors.length == 1, "block.successors.length == 1", "leg/ssa/codegen.dart", 39, 16);
+ visitBasicBlockAndSuccessors((($0 = block.successors.$index(0)) && $0.is$HBasicBlock()));
}
}
visitBasicBlockAndSuccessors(graph.entry);
@@ -6666,11 +6820,12 @@ SsaCodeGenerator.prototype.temporary = function(instruction) {
return ('t' + instruction.id + '');
}
SsaCodeGenerator.prototype.invoke = function(selector, arguments) {
+ var $0;
this.buffer.add(("" + selector + "("));
for (var i = 0;
- i < arguments.length; i++) {
- if (i != 0) this.buffer.add(', ');
- this.use(arguments.$index(i));
+ $notnull_bool(i < arguments.length); i++) {
+ if ($notnull_bool(i != 0)) this.buffer.add(', ');
+ this.use((($0 = arguments.$index(i)) && $0.is$HInstruction()));
}
this.buffer.add(")");
}
@@ -6679,7 +6834,7 @@ SsaCodeGenerator.prototype.define = function(instruction) {
this.visit(instruction);
}
SsaCodeGenerator.prototype.use = function(argument) {
- if (argument.canBeGeneratedAtUseSite()) {
+ if ($notnull_bool(argument.canBeGeneratedAtUseSite())) {
this.visit(argument);
}
else {
@@ -6694,10 +6849,10 @@ SsaCodeGenerator.prototype.visitAdd = function(node) {
}
SsaCodeGenerator.prototype.visitBasicBlock = function(node) {
var instruction = node.first;
- while (instruction != null) {
- if (!instruction.canBeSkipped()) {
+ while ($notnull_bool(instruction != null)) {
+ if ($notnull_bool(!instruction.canBeSkipped())) {
this.buffer.add(' ');
- if (!instruction.get$usedBy().isEmpty()) {
+ if ($notnull_bool(!instruction.get$usedBy().isEmpty())) {
this.define(instruction);
}
else {
@@ -6727,8 +6882,9 @@ SsaCodeGenerator.prototype.visitMultiply = function(node) {
this.invoke(const$268/*const SourceString('\$mul')*/, node.inputs);
}
SsaCodeGenerator.prototype.visitReturn = function(node) {
+ var $0;
this.buffer.add('return ');
- this.use(node.inputs.$index(0));
+ this.use((($0 = node.inputs.$index(0)) && $0.is$HInstruction()));
}
SsaCodeGenerator.prototype.visitSubtract = function(node) {
this.invoke(const$269/*const SourceString('\$sub')*/, node.inputs);
@@ -6743,10 +6899,11 @@ function HGraphVisitor() {
HGraphVisitor.prototype.visitDominatorTree = function(graph) {
var $this = this; // closure support
function visitBasicBlockAndSuccessors(block) {
+ var $0;
$this.visitBasicBlock(block);
for (var i = 0;
- i < block.successors.length; i++) {
- visitBasicBlockAndSuccessors(block.successors.$index(i));
+ $notnull_bool(i < block.successors.length); i++) {
+ visitBasicBlockAndSuccessors((($0 = block.successors.$index(i)) && $0.is$HBasicBlock()));
}
}
visitBasicBlockAndSuccessors(graph.entry);
@@ -6754,9 +6911,10 @@ HGraphVisitor.prototype.visitDominatorTree = function(graph) {
HGraphVisitor.prototype.visitPostDominatorTree = function(graph) {
var $this = this; // closure support
function visitBasicBlockAndSuccessors(block) {
+ var $0;
for (var i = 0;
- i < block.successors.length; i++) {
- visitBasicBlockAndSuccessors(block.successors.$index(i));
+ $notnull_bool(i < block.successors.length); i++) {
+ visitBasicBlockAndSuccessors((($0 = block.successors.$index(i)) && $0.is$HBasicBlock()));
}
$this.visitBasicBlock(block);
}
@@ -6771,7 +6929,7 @@ $inherits(HInstructionVisitor, HGraphVisitor);
HInstructionVisitor.prototype.visitBasicBlock = function(node) {
this.currentBlock = node;
var instruction = node.first;
- while (instruction != null) {
+ while ($notnull_bool(instruction != null)) {
this.visitInstruction(instruction);
instruction = instruction.next;
}
@@ -6786,19 +6944,22 @@ function HGraph() {
HGraph.prototype.number = function() {
var basicBlockId = 0;
function numberBasicBlockAndSuccessors(block, id) {
+ var $0;
id = block.number(basicBlockId++, id);
for (var i = 0;
- i < block.successors.length; i++) {
- id = numberBasicBlockAndSuccessors(block.successors.$index(i), id);
+ $notnull_bool(i < block.successors.length); i++) {
+ id = numberBasicBlockAndSuccessors((($0 = block.successors.$index(i)) && $0.is$HBasicBlock()), id);
}
return id;
}
numberBasicBlockAndSuccessors(this.entry, 0);
}
HGraph.prototype.setSuccessors = function(source, targets) {
+ $assert(((source.last instanceof HGoto) || (source.last instanceof HReturn)) && targets.length == 1, "(source.last is HGoto || source.last is HReturn) &&\n targets.length == 1", "leg/ssa/nodes.dart", 83, 12);
+ $assert(source.successors.isEmpty(), "source.successors.isEmpty()", "leg/ssa/nodes.dart", 85, 12);
source.successors = targets;
for (var i = 0;
- i < targets.length; i++) {
+ $notnull_bool(i < targets.length); i++) {
targets.$index(i).predecessors.add(source);
}
}
@@ -6816,7 +6977,7 @@ $inherits(HBaseVisitor, HGraphVisitor);
HBaseVisitor.prototype.visitBasicBlock = function(node) {
this.currentBlock = node;
var instruction = node.first;
- while (instruction != null) {
+ while ($notnull_bool(instruction != null)) {
instruction.accept(this);
instruction = instruction.next;
}
@@ -6865,10 +7026,11 @@ function HBasicBlock() {
this.successors = const$226/*const []*/;
// Initializers done
}
+HBasicBlock.prototype.is$HBasicBlock = function(){return this;};
HBasicBlock.prototype.number = function(basicBlockId, id0) {
this.id = basicBlockId;
var instruction = this.first;
- while (instruction != null) {
+ while ($notnull_bool(instruction != null)) {
instruction.id = id0++;
instruction = instruction.next;
}
@@ -6881,10 +7043,10 @@ HBasicBlock.prototype.add = function(instruction) {
this.addAfter(this.last, instruction);
}
HBasicBlock.prototype.addAfter = function(cursor, instruction) {
- if (cursor == null) {
+ if ($notnull_bool(cursor == null)) {
this.first = this.last = instruction;
}
- else if (cursor === this.last) {
+ else if ($notnull_bool(cursor === this.last)) {
this.last.next = instruction;
instruction.previous = this.last;
this.last = instruction;
@@ -6898,13 +7060,15 @@ HBasicBlock.prototype.addAfter = function(cursor, instruction) {
instruction.notifyAddedToBlock();
}
HBasicBlock.prototype.remove = function(instruction) {
- if (instruction.previous == null) {
+ $assert(instruction.isInBasicBlock(), "instruction.isInBasicBlock()", "leg/ssa/nodes.dart", 183, 12);
+ $assert(instruction.get$usedBy().isEmpty(), "instruction.usedBy.isEmpty()", "leg/ssa/nodes.dart", 184, 12);
+ if ($notnull_bool(instruction.previous == null)) {
this.first = instruction.next;
}
else {
instruction.previous.next = instruction.next;
}
- if (instruction.next == null) {
+ if ($notnull_bool(instruction.next == null)) {
this.last = instruction.previous;
}
else {
@@ -6920,12 +7084,13 @@ HBasicBlock.prototype.rewrite = function(from, to) {
}
to.get$usedBy().addAll(from.get$usedBy());
from._usedBy = [];
+ $assert(this.isValid(), "isValid()", "leg/ssa/nodes.dart", 208, 12);
}
HBasicBlock.rewriteInput = function(instruction, from, to) {
var inputs = instruction.inputs;
for (var i = 0;
- i < inputs.length; i++) {
- if (inputs.$index(i) === from) inputs.$setindex(i, to);
+ $notnull_bool(i < inputs.length); i++) {
+ if ($notnull_bool(inputs.$index(i) === from)) inputs.$setindex(i, to);
}
}
HBasicBlock.prototype.isExitBlock = function() {
@@ -6945,6 +7110,7 @@ function HInstruction(inputs) {
this.inputs = inputs;
// Initializers done
}
+HInstruction.prototype.is$HInstruction = function(){return this;};
HInstruction.prototype.canBeGeneratedAtUseSite = function() {
return this._canBeGeneratedAtUseSite;
}
@@ -6955,7 +7121,7 @@ HInstruction.prototype.canBeSkipped = function() {
return this.canBeGeneratedAtUseSite();
}
HInstruction.prototype.get$usedBy = function() {
- if (this._usedBy == null) return const$226/*const []*/;
+ if ($notnull_bool(this._usedBy == null)) return const$226/*const []*/;
return this._usedBy;
}
HInstruction.prototype.isInBasicBlock = function() {
@@ -6968,19 +7134,23 @@ HInstruction.prototype.hashCode = function() {
return 0;
}
HInstruction.prototype.notifyAddedToBlock = function() {
+ $assert(!this.isInBasicBlock(), "!isInBasicBlock()", "leg/ssa/nodes.dart", 283, 12);
this._usedBy = [];
for (var i = 0;
- i < this.inputs.length; i++) {
+ $notnull_bool(i < this.inputs.length); i++) {
this.inputs.$index(i).get$usedBy().add(this);
}
+ $assert(this.isValid(), "isValid()", "leg/ssa/nodes.dart", 289, 12);
}
HInstruction.prototype.notifyRemovedFromBlock = function() {
+ $assert(this.isInBasicBlock(), "isInBasicBlock()", "leg/ssa/nodes.dart", 293, 12);
+ $assert(this.get$usedBy().isEmpty(), "usedBy.isEmpty()", "leg/ssa/nodes.dart", 294, 12);
for (var i = 0;
- i < this.inputs.length; i++) {
+ $notnull_bool(i < this.inputs.length); i++) {
var inputUsedBy = this.inputs.$index(i).get$usedBy();
for (var j = 0;
- j < inputUsedBy.length; j++) {
- if (inputUsedBy.$index(j) === this) {
+ $notnull_bool(j < inputUsedBy.length); j++) {
+ if ($notnull_bool(inputUsedBy.$index(j) === this)) {
inputUsedBy.$setindex(j, inputUsedBy.$index(inputUsedBy.length - 1));
inputUsedBy.removeLast();
break;
@@ -6988,6 +7158,7 @@ HInstruction.prototype.notifyRemovedFromBlock = function() {
}
}
this._usedBy = null;
+ $assert(this.isValid(), "isValid()", "leg/ssa/nodes.dart", 308, 12);
}
HInstruction.prototype.isValid = function() {
var validator = new HValidator();
@@ -7171,11 +7342,11 @@ SsaConstantFolder.prototype.visitGraph = function(graph) {
}
SsaConstantFolder.prototype.visitBasicBlock = function(block) {
var instruction = block.first;
- while (instruction != null) {
+ while ($notnull_bool(instruction != null)) {
var replacement = instruction.accept(this);
- if (replacement !== instruction) {
- block.addAfter(instruction, replacement);
- block.rewrite(instruction, replacement);
+ if ($notnull_bool(replacement !== instruction)) {
+ block.addAfter(instruction, (replacement && replacement.is$HInstruction()));
+ block.rewrite(instruction, (replacement && replacement.is$HInstruction()));
block.remove(instruction);
}
instruction = instruction.next;
@@ -7189,7 +7360,8 @@ SsaConstantFolder.prototype.visitArithmetic = function(node, operation) {
return (input instanceof HLiteral) && (typeof(input.get$value()) == 'number');
}
var inputs = node.inputs;
- if (isNumber(inputs.$index(0)) && isNumber(inputs.$index(1))) {
+ $assert(inputs.length == 2, "inputs.length == 2", "leg/ssa/optimize.dart", 50, 12);
+ if ($notnull_bool(isNumber(inputs.$index(0)) && isNumber(inputs.$index(1)))) {
switch (operation) {
case '+':
@@ -7206,14 +7378,14 @@ SsaConstantFolder.prototype.visitArithmetic = function(node, operation) {
case '/':
{
- if ($eq(inputs.$index(1).get$value(), 0)) return node;
+ if ($notnull_bool($eq(inputs.$index(1).get$value(), 0))) return node;
return new HLiteral(inputs.$index(0).get$value() / inputs.$index(1).get$value());
}
case '~/':
{
- if ($eq(inputs.$index(1).get$value(), 0)) return node;
+ if ($notnull_bool($eq(inputs.$index(1).get$value(), 0))) return node;
return new HLiteral($truncdiv(inputs.$index(0).get$value(), inputs.$index(1).get$value()));
}
@@ -7239,10 +7411,10 @@ SsaDeadCodeEliminator.prototype.visitGraph = function(graph) {
}
SsaDeadCodeEliminator.prototype.visitBasicBlock = function(block) {
var instruction = block.last;
- while (instruction != null) {
+ while ($notnull_bool(instruction != null)) {
var previous = instruction.previous;
- if (SsaDeadCodeEliminator.isDeadCode(instruction)) block.remove(instruction);
- instruction = previous;
+ if ($notnull_bool(SsaDeadCodeEliminator.isDeadCode(instruction))) block.remove(instruction);
+ instruction = (previous && previous.is$HInstruction());
}
}
// ********** Code for SsaGlobalValueNumberer **************
@@ -7257,13 +7429,13 @@ SsaGlobalValueNumberer.prototype.visitGraph = function(graph) {
}
SsaGlobalValueNumberer.prototype.visitBasicBlock = function(block) {
var instruction = block.first;
- while (instruction != null) {
- if (instruction.hasSideEffects()) {
+ while ($notnull_bool(instruction != null)) {
+ if ($notnull_bool(instruction.hasSideEffects())) {
this.values.clear();
}
else {
var other = this.values.$index(instruction);
- if (other != null) {
+ if ($notnull_bool(other != null)) {
block.rewrite(instruction, other);
block.remove(instruction);
}
@@ -7287,10 +7459,10 @@ SsaInstructionMerger.prototype.visitInstruction = function(node) {
var inputs = node.inputs;
var previousUnused = node.previous;
for (var i = inputs.length - 1;
- i >= 0; i--) {
- if (previousUnused == null) return;
- if (inputs.$index(i).get$usedBy().length != 1) return;
- if (inputs.$index(i) !== previousUnused) return;
+ $notnull_bool(i >= 0); i--) {
+ if ($notnull_bool(previousUnused == null)) return;
+ if ($notnull_bool(inputs.$index(i).get$usedBy().length != 1)) return;
+ if ($notnull_bool(inputs.$index(i) !== previousUnused)) return;
inputs.$index(i).setCanBeGeneratedAtUseSite();
previousUnused = previousUnused.previous;
}
@@ -7305,7 +7477,7 @@ HTracer._internal$ctor = function() {
HTracer._internal$ctor.prototype = HTracer.prototype;
$inherits(HTracer, HGraphVisitor);
HTracer.HTracer$singleton$factory = function() {
- if (HTracer._singleton == null) HTracer._singleton = new HTracer._internal$ctor();
+ if ($notnull_bool(HTracer._singleton == null)) HTracer._singleton = new HTracer._internal$ctor();
return HTracer._singleton;
}
HTracer.prototype.traceCompilation = function(methodName) {
@@ -7327,7 +7499,7 @@ HTracer.prototype.traceGraph = function(name, graph) {
);
}
HTracer.prototype.addPredecessors = function(block) {
- if (block.predecessors.isEmpty()) {
+ if ($notnull_bool(block.predecessors.isEmpty())) {
this.printEmptyProperty("predecessors");
}
else {
@@ -7342,7 +7514,7 @@ HTracer.prototype.addPredecessors = function(block) {
}
}
HTracer.prototype.addSuccessors = function(block) {
- if (block.successors.isEmpty()) {
+ if ($notnull_bool(block.successors.isEmpty())) {
this.printEmptyProperty("successors");
}
else {
@@ -7359,7 +7531,7 @@ HTracer.prototype.addSuccessors = function(block) {
HTracer.prototype.addInstructions = function(block) {
var stringifier = new HInstructionStringifier(block);
for (var instruction = block.first;
- instruction != null; instruction = instruction.next) {
+ $notnull_bool(instruction != null); instruction = instruction.next) {
var bci = 0;
var uses = instruction.get$usedBy().length;
this.addIndent();
@@ -7370,6 +7542,7 @@ HTracer.prototype.addInstructions = function(block) {
}
HTracer.prototype.visitBasicBlock = function(block) {
var $this = this; // closure support
+ $assert(block.id != null, "block.id !== null", "leg/ssa/tracer.dart", 75, 12);
this.tag("block", (function () {
$this.printProperty("name", ("B" + block.id + ""));
$this.printProperty("from_bci", -1);
@@ -7409,7 +7582,7 @@ HTracer.prototype.printEmptyProperty = function(propertyName) {
this.print(propertyName);
}
HTracer.prototype.printProperty = function(propertyName, value) {
- if ((typeof(value) == 'number')) {
+ if ($notnull_bool((typeof(value) == 'number'))) {
this.print(("" + propertyName + " " + value + ""));
}
else {
@@ -7421,7 +7594,7 @@ HTracer.prototype.add = function(string) {
}
HTracer.prototype.addIndent = function() {
for (var i = 0;
- i < this.indent; i++) {
+ $notnull_bool(i < this.indent); i++) {
this.add(" ");
}
}
@@ -7456,11 +7629,12 @@ HInstructionStringifier.prototype.visitGoto = function(node) {
return ("Goto (B" + target.id + ")");
}
HInstructionStringifier.prototype.visitInvoke = function(invoke) {
+ var $0;
var arguments = new StringBufferImpl("");
for (var i = 0;
- i < invoke.inputs.length; i++) {
- if (i != 0) arguments.add(", ");
- arguments.add(this.temporaryId(invoke.inputs.$index(i)));
+ $notnull_bool(i < invoke.inputs.length); i++) {
+ if ($notnull_bool(i != 0)) arguments.add(", ");
+ arguments.add(this.temporaryId((($0 = invoke.inputs.$index(i)) && $0.is$HInstruction())));
}
return ("Invoke: " + invoke.selector + "(" + arguments + ")");
}
@@ -7471,7 +7645,8 @@ HInstructionStringifier.prototype.visitMultiply = function(node) {
return this.visitInvoke(node);
}
HInstructionStringifier.prototype.visitReturn = function(node) {
- return ("Return " + this.temporaryId(node.inputs.$index(0)) + "");
+ var $0;
+ return ("Return " + this.temporaryId((($0 = node.inputs.$index(0)) && $0.is$HInstruction())) + "");
}
HInstructionStringifier.prototype.visitSubtract = function(node) {
return this.visitInvoke(node);
@@ -7491,45 +7666,45 @@ HValidator.prototype.visitGraph = function(graph0) {
this.visitDominatorTree(graph0);
}
HValidator.prototype.visitBasicBlock = function(block) {
- if (!this.isValid) return;
- if (block.first == null || block.last == null) this.isValid = false;
- if (!(block.last instanceof HGoto) && !(block.last instanceof HReturn) && !(block.last instanceof HExit)) {
+ if ($notnull_bool(!this.isValid)) return;
+ if ($notnull_bool(block.first == null || block.last == null)) this.isValid = false;
+ if ($notnull_bool(!(block.last instanceof HGoto) && !(block.last instanceof HReturn) && !(block.last instanceof HExit))) {
this.isValid = false;
}
- if ((block.last instanceof HGoto) && block.successors.length != 1) this.isValid = false;
- if ((block.last instanceof HReturn) && (block.successors.length != 1 || !block.successors.$index(0).isExitBlock())) {
+ if ($notnull_bool((block.last instanceof HGoto) && block.successors.length != 1)) this.isValid = false;
+ if ($notnull_bool((block.last instanceof HReturn) && (block.successors.length != 1 || !block.successors.$index(0).isExitBlock()))) {
this.isValid = false;
}
- if ((block.last instanceof HExit) && !block.successors.isEmpty()) this.isValid = false;
- if (block.successors.isEmpty() && (block.first !== block.last || !(block.last instanceof HExit))) {
+ if ($notnull_bool((block.last instanceof HExit) && !block.successors.isEmpty())) this.isValid = false;
+ if ($notnull_bool(block.successors.isEmpty() && (block.first !== block.last || !(block.last instanceof HExit)))) {
this.isValid = false;
}
- if (!this.isValid) return;
+ if ($notnull_bool(!this.isValid)) return;
HInstructionVisitor.prototype.visitBasicBlock.call(this, block);
}
HValidator.countInstruction = function(instructions, instruction) {
var result = 0;
for (var i = 0;
- i < instructions.length; i++) {
- if (instructions.$index(i) === instruction) result++;
+ $notnull_bool(i < instructions.length); i++) {
+ if ($notnull_bool(instructions.$index(i) === instruction)) result++;
}
return result;
}
HValidator.everyInstruction = function(instructions, f) {
var copy = ListFactory.ListFactory$from$factory(instructions);
for (var i = 0;
- i < copy.length; i++) {
+ $notnull_bool(i < copy.length); i++) {
var current = copy.$index(i);
- if (current == null) continue;
+ if ($notnull_bool(current == null)) continue;
var count = 1;
for (var j = i + 1;
- j < copy.length; j++) {
- if (copy.$index(j) === current) {
+ $notnull_bool(j < copy.length); j++) {
+ if ($notnull_bool(copy.$index(j) === current)) {
copy.$setindex(j);
count++;
}
}
- if (!f.call$2(current, count)) return false;
+ if ($notnull_bool(!f.call$2(current, count))) return false;
}
return true;
}
@@ -7538,23 +7713,23 @@ HValidator.prototype.visitInstruction = function(instruction) {
function hasCorrectInputs(instruction0) {
var inBasicBlock = instruction0.isInBasicBlock();
return HValidator.everyInstruction(instruction0.inputs, (function (input, count) {
- if (inBasicBlock) {
- return HValidator.countInstruction(input.get$usedBy(), instruction0) == count;
+ if ($notnull_bool(inBasicBlock)) {
+ return HValidator.countInstruction(input.get$usedBy(), (instruction0 && instruction0.is$HInstruction())) == count;
}
else {
- return HValidator.countInstruction(input.get$usedBy(), instruction0) == 0;
+ return HValidator.countInstruction(input.get$usedBy(), (instruction0 && instruction0.is$HInstruction())) == 0;
}
})
);
}
function hasCorrectUses(instruction0) {
- if (!instruction0.isInBasicBlock()) return true;
+ if ($notnull_bool(!instruction0.isInBasicBlock())) return true;
return HValidator.everyInstruction(instruction0.get$usedBy(), (function (use, count) {
- return HValidator.countInstruction(use.inputs, instruction0) == count;
+ return HValidator.countInstruction(use.inputs, (instruction0 && instruction0.is$HInstruction())) == count;
})
);
}
- this.isValid = this.isValid && hasCorrectInputs(instruction) && hasCorrectUses(instruction);
+ this.isValid = $assert_bool(this.isValid && hasCorrectInputs(instruction) && hasCorrectUses(instruction));
}
// ********** Code for top level **************
// ********** Library leg **************
@@ -7566,15 +7741,15 @@ function WorldCompiler(world, script0) {
}
$inherits(WorldCompiler, Compiler);
WorldCompiler.prototype.log = function(message) {
- if (options.showInfo) {
+ if ($notnull_bool(options.showInfo)) {
this.world.info(('[leg] ' + message + ''));
}
}
WorldCompiler.prototype.run = function() {
var success = Compiler.prototype.run.call(this);
- if (success) {
+ if ($notnull_bool(success)) {
var code = this.getGeneratedCode();
- this.world.legCode = code;
+ this.world.legCode = $assert_String(code);
this.world.jsBytesWritten = code.length;
var $list = this.tasks;
for (var $i0 = 0;$i0 < $list.length; $i0++) {
@@ -7587,7 +7762,7 @@ WorldCompiler.prototype.run = function() {
WorldCompiler.prototype.spanFromNode = function(node) {
var begin = node.getBeginToken();
var end = node.getEndToken();
- if (begin == null || end == null) {
+ if ($notnull_bool(begin == null || end == null)) {
this.cancel(('cannot find tokens to produce error message for ' + node + '.'));
}
var startOffset = begin.get$charOffset();
@@ -7595,14 +7770,15 @@ WorldCompiler.prototype.spanFromNode = function(node) {
return new SourceSpan(this.script.file, startOffset, endOffset);
}
WorldCompiler.prototype.reportWarning = function(node, message) {
- this.world.warning(('' + message + '.'), this.spanFromNode(node));
+ var $0;
+ this.world.warning(('' + message + '.'), (($0 = this.spanFromNode(node)) && $0.is$SourceSpan()));
}
// ********** Code for Compiler **************
function Compiler(script) {
this.script = script;
// Initializers done
this.universe = new Universe();
- this.worklist = DoubleLinkedQueue.DoubleLinkedQueue$from$factory([const$2/*Compiler.MAIN*/]);
+ this.worklist = DoubleLinkedQueue.DoubleLinkedQueue$from$factory([const$3/*Compiler.MAIN*/]);
this.scanner = new ScannerTask(this);
this.resolver = new ResolverTask(this);
this.checker = new TypeCheckerTask(this);
@@ -7630,7 +7806,7 @@ Compiler.prototype.run = function() {
this.log('compilation failed');
return false;
}
- if (false/*null.GENERATE_SSA_TRACE*/) {
+ if ($notnull_bool(false/*null.GENERATE_SSA_TRACE*/)) {
print("------------------");
print(HTracer.HTracer$singleton$factory());
print("------------------");
@@ -7640,10 +7816,10 @@ Compiler.prototype.run = function() {
}
Compiler.prototype.runCompiler = function() {
this.scanner.scan(this.script);
- while (!this.worklist.isEmpty()) {
+ while ($notnull_bool(!this.worklist.isEmpty())) {
var name = this.worklist.removeLast();
var element = this.universe.find(name);
- if (element == null) this.cancel(('Could not find ' + name + ''));
+ if ($notnull_bool(element == null)) this.cancel(('Could not find ' + name + ''));
var tree = element.parseNode(this, this);
var elements = this.resolver.resolve(tree);
this.checker.check(tree, elements);
@@ -7663,7 +7839,7 @@ Compiler.prototype.getGeneratedCode = function() {
buffer.add("function $tdiv(a, b) {\n var tmp = this / other;\n if (tmp < 0) {\n return Math.ceil(tmp);\n } else {\n return Math.floor(tmp);\n }\n}\n"/*null.TDIV_SUPPORT*/);
var codeBlocks = this.universe.generatedCode.getValues();
for (var i = codeBlocks.length - 1;
- i >= 0; i--) {
+ $notnull_bool(i >= 0); i--) {
buffer.add(codeBlocks.$index(i));
}
buffer.add('main();\n');
@@ -7694,7 +7870,7 @@ function CompilerCancelledException(reason) {
}
CompilerCancelledException.prototype.toString = function() {
var banner = 'compiler cancelled';
- return (this.reason != null) ? ('' + banner + ': ' + this.reason + '') : ('' + banner + '');
+ return $notnull_bool((this.reason != null)) ? ('' + banner + ': ' + this.reason + '') : ('' + banner + '');
}
// ********** Code for ResolverTask **************
function ResolverTask(compiler0) {
@@ -7725,9 +7901,9 @@ ResolverVisitor.prototype.fail = function(node) {
this.compiler.cancel(('cannot resolve ' + node + ''));
}
ResolverVisitor.prototype.visit = function(node) {
- if (node == null) return null;
+ if ($notnull_bool(node == null)) return null;
var element = node.accept(this);
- if (element != null) {
+ if ($notnull_bool(element != null)) {
this.mapping.$setindex(node, element);
}
return element;
@@ -7745,14 +7921,14 @@ ResolverVisitor.prototype.visitExpressionStatement = function(node) {
this.visit(node.expression);
}
ResolverVisitor.prototype.visitFunctionExpression = function(node) {
- if (!node.parameters.nodes.isEmpty()) this.fail(node);
+ if ($notnull_bool(!node.parameters.nodes.isEmpty())) this.fail(node);
var enclosingElement = this.visit(node.name);
this.visitIn(node.body, new Scope.enclosing$ctor(this.context, enclosingElement));
return enclosingElement;
}
ResolverVisitor.prototype.visitIdentifier = function(node) {
var element = this.context.lookup(node.get$source());
- if (element == null) this.fail(node);
+ if ($notnull_bool(element == null)) this.fail(node);
return element;
}
ResolverVisitor.prototype.visitIf = function(node) {
@@ -7761,14 +7937,15 @@ ResolverVisitor.prototype.visitIf = function(node) {
this.visit(node.elsePart);
}
ResolverVisitor.prototype.visitSend = function(node) {
+ var $0;
var target = null;
this.visit(node.receiver);
var name = node.selector.get$source();
- if ($eq(name, const$248/*const SourceString('print')*/) || $eq(name, const$249/*const SourceString('+')*/) || $eq(name, const$250/*const SourceString('-')*/) || $eq(name, const$251/*const SourceString('*')*/) || $eq(name, const$252/*const SourceString('/')*/) || $eq(name, const$253/*const SourceString('~/')*/)) {
+ if ($notnull_bool($eq(name, const$248/*const SourceString('print')*/) || $eq(name, const$249/*const SourceString('+')*/) || $eq(name, const$250/*const SourceString('-')*/) || $eq(name, const$251/*const SourceString('*')*/) || $eq(name, const$252/*const SourceString('/')*/) || $eq(name, const$253/*const SourceString('~/')*/))) {
}
else {
- target = this.visit(node.selector);
- if (target == null) {
+ target = (($0 = this.visit(node.selector)) && $0.is$Element());
+ if ($notnull_bool(target == null)) {
this.fail(node);
}
else {
@@ -7794,9 +7971,10 @@ ResolverVisitor.prototype.visitLiteralString = function(node) {
}
ResolverVisitor.prototype.visitNodeList = function(node) {
+ var $0;
for (var link = node.nodes;
- !link.isEmpty(); link = link.get$tail()) {
- this.visit(link.get$head());
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$Node())) {
+ this.visit((($0 = link.get$head()) && $0.is$Node()));
}
}
ResolverVisitor.prototype.visitOperator = function(node) {
@@ -7824,9 +8002,12 @@ function VariableDefinitionsVisitor(definitions, resolver) {
// Initializers done
}
VariableDefinitionsVisitor.prototype.visitSend = function(node) {
+ var $0;
+ $assert(node.get$arguments().get$tail().isEmpty(), "node.arguments.tail.isEmpty()", "leg/resolver.dart", 157, 12);
var selector = node.selector;
var name = selector.get$source();
- this.resolver.visit(node.get$arguments().get$head());
+ $assert($eq(name, const$244/*const SourceString('=')*/), "name == const SourceString('=')", "leg/resolver.dart", 160, 12);
+ this.resolver.visit((($0 = node.get$arguments().get$head()) && $0.is$Node()));
this.visit(node.receiver);
}
VariableDefinitionsVisitor.prototype.visitIdentifier = function(node) {
@@ -7834,9 +8015,10 @@ VariableDefinitionsVisitor.prototype.visitIdentifier = function(node) {
this.resolver.setElement(node, variableElement);
}
VariableDefinitionsVisitor.prototype.visitNodeList = function(node) {
+ var $0;
for (var link = node.nodes;
- !link.isEmpty(); link = link.get$tail()) {
- this.visit(link.get$head());
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$Node())) {
+ this.visit((($0 = link.get$head()) && $0.is$Node()));
}
}
VariableDefinitionsVisitor.prototype.visit = function(node) {
@@ -7864,7 +8046,7 @@ Scope.enclosing$ctor.prototype = Scope.prototype;
Scope.prototype.get$parent = function() { return this.parent; };
Scope.prototype.lookup = function(name) {
var element = this.elements.$index(name);
- if (element != null) return element;
+ if ($notnull_bool(element != null)) return element;
return this.parent.lookup(name);
}
Scope.prototype.add = function(element) {
@@ -7895,10 +8077,11 @@ ScannerTask.prototype.get$name = function() {
ScannerTask.prototype.scan = function(script) {
var $this = this; // closure support
this.measure((function () {
+ var $0;
var elements = $this.scanElements(script.get$text());
for (var link = elements;
- !link.isEmpty(); link = link.get$tail()) {
- $this.compiler.universe.define(link.get$head());
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$Element())) {
+ $this.compiler.universe.define((($0 = link.get$head()) && $0.is$Element()));
}
})
);
@@ -7946,6 +8129,7 @@ function SimpleType(name, element) {
this.element = element;
// Initializers done
}
+SimpleType.prototype.is$Type = function(){return this;};
SimpleType.prototype.get$name = function() { return this.name; };
SimpleType.prototype.get$element = function() { return this.element; };
SimpleType.prototype.toString = function() {
@@ -7957,14 +8141,16 @@ function FunctionType(returnType, parameterTypes) {
this.parameterTypes = parameterTypes;
// Initializers done
}
+FunctionType.prototype.is$Type = function(){return this;};
FunctionType.prototype.get$returnType = function() { return this.returnType; };
FunctionType.prototype.toString = function() {
+ var $0;
var sb = new StringBufferImpl("");
var first = true;
sb.add('(');
for (var link = this.parameterTypes;
- !link.isEmpty(); link = link.get$tail()) {
- if (!first) sb.add(', ');
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$Type())) {
+ if ($notnull_bool(!first)) sb.add(', ');
first = false;
sb.add(link.get$head());
}
@@ -8021,29 +8207,30 @@ TypeCheckerVisitor.prototype.visitIdentifier = function(node) {
TypeCheckerVisitor.prototype.visitIf = function(node) {
this.visit(node.condition);
this.visit(node.thenPart);
- if (node.get$hasElsePart()) this.visit(node.elsePart);
+ if ($notnull_bool(node.get$hasElsePart())) this.visit(node.elsePart);
return this.types.VOID;
}
TypeCheckerVisitor.prototype.visitSend = function(node) {
+ var $0;
var target = this.elements.$index(node);
- if (target != null) {
+ if ($notnull_bool(target != null)) {
var funType = target.computeType(this.compiler, this.types);
var formals = funType.parameterTypes;
var arguments = node.get$arguments();
- while ((!formals.isEmpty()) && (!arguments.isEmpty())) {
+ while ($notnull_bool((!formals.isEmpty()) && (!arguments.isEmpty()))) {
this.compiler.cancel('parameters not supported.');
- var argumentType = this.visit(arguments.get$head());
- if (!this.types.isAssignable(formals.get$head(), argumentType)) {
- var warning = CompilerError.NOT_ASSIGNABLE(argumentType, formals.get$head());
+ var argumentType = this.visit((($0 = arguments.get$head()) && $0.is$Node()));
+ if ($notnull_bool(!this.types.isAssignable((($0 = formals.get$head()) && $0.is$Type()), (argumentType && argumentType.is$Type())))) {
+ var warning = CompilerError.NOT_ASSIGNABLE((argumentType && argumentType.is$Type()), (($0 = formals.get$head()) && $0.is$Type()));
this.compiler.reportWarning(node, warning);
}
- formals = formals.get$tail();
- arguments = arguments.get$tail();
+ formals = (($0 = formals.get$tail()) && $0.is$Link$Type());
+ arguments = (($0 = arguments.get$tail()) && $0.is$Link$Node());
}
- if (!formals.isEmpty()) {
+ if ($notnull_bool(!formals.isEmpty())) {
this.compiler.reportWarning(node, 'missing argument');
}
- if (!arguments.isEmpty()) {
+ if ($notnull_bool(!arguments.isEmpty())) {
this.compiler.reportWarning(node, 'additional arguments');
}
return funType.returnType;
@@ -8051,7 +8238,7 @@ TypeCheckerVisitor.prototype.visitSend = function(node) {
else {
var selector = node.selector;
var name = selector.get$source();
- if ($eq(name, const$248/*const SourceString('print')*/) || $eq(name, const$249/*const SourceString('+')*/)) {
+ if ($notnull_bool($eq(name, const$248/*const SourceString('print')*/) || $eq(name, const$249/*const SourceString('+')*/))) {
return this.types.DYNAMIC;
}
this.compiler.cancel(('unresolved send ' + name + '.'));
@@ -8073,9 +8260,10 @@ TypeCheckerVisitor.prototype.visitLiteralString = function(node) {
return this.types.DYNAMIC;
}
TypeCheckerVisitor.prototype.visitNodeList = function(node) {
+ var $0;
for (var link = node.nodes;
- !link.isEmpty(); link = link.get$tail()) {
- this.visit(link.get$head());
+ $notnull_bool(!link.isEmpty()); link = (($0 = link.get$tail()) && $0.is$Link$Node())) {
+ this.visit((($0 = link.get$head()) && $0.is$Node()));
}
}
TypeCheckerVisitor.prototype.visitOperator = function(node) {
@@ -8086,14 +8274,14 @@ TypeCheckerVisitor.prototype.visitParameter = function(node) {
}
TypeCheckerVisitor.prototype.visitReturn = function(node) {
var expressionType = this.visit(node.expression);
- if (!this.types.isAssignable(this.expectedReturnType, expressionType)) {
+ if ($notnull_bool(!this.types.isAssignable(this.expectedReturnType, expressionType))) {
var error = CompilerError.NOT_ASSIGNABLE(this.expectedReturnType, expressionType);
this.compiler.reportWarning(node, error);
}
return this.types.VOID;
}
TypeCheckerVisitor.prototype.visitTypeAnnotation = function(node) {
- if (node.typeName != null && $ne(node.typeName.get$source(), const$254/*const SourceString('void')*/)) {
+ if ($notnull_bool(node.typeName != null && $ne(node.typeName.get$source(), const$254/*const SourceString('void')*/))) {
this.compiler.cancel(('unsupported type ' + node.typeName + ''));
}
return this.types.VOID;
@@ -8105,13 +8293,14 @@ TypeCheckerVisitor.prototype.visitVariableDefinitions = function(node) {
function Universe() {
this.elements = $map([]);
this.generatedCode = $map([]);
- this.scope = new Element(const$1/*const SourceString('global scope')*/);
+ this.scope = new Element(const$2/*const SourceString('global scope')*/);
// Initializers done
}
Universe.prototype.find = function(name) {
return this.elements.$index(name);
}
Universe.prototype.define = function(element) {
+ $assert(this.elements.$index(element.name) == null, "elements[element.name] == null", "leg/universe.dart", 19, 12);
this.elements.$setindex(element.name, element);
}
Universe.prototype.addGeneratedCode = function(element, code) {
@@ -8136,41 +8325,42 @@ function CodeWriter() {
this._buf = new StringBufferImpl("");
// Initializers done
}
+CodeWriter.prototype.is$CodeWriter = function(){return this;};
CodeWriter.prototype.get$text = function() {
return this._buf.toString();
}
CodeWriter.prototype._indent = function() {
this._pendingIndent = false;
for (var i = 0;
- i < this._indentation; i++) {
+ $notnull_bool(i < this._indentation); i++) {
this._buf.add(' '/*CodeWriter.INDENTATION*/);
}
}
CodeWriter.prototype.comment = function(text0) {
- if (this.writeComments) {
+ if ($notnull_bool(this.writeComments)) {
this.writeln(text0);
}
}
CodeWriter.prototype.write = function(text0) {
- if (text0.length == 0) return;
- if (this._pendingIndent) this._indent();
- if (text0.indexOf('\n', 0) != -1) {
+ if ($notnull_bool(text0.length == 0)) return;
+ if ($notnull_bool(this._pendingIndent)) this._indent();
+ if ($notnull_bool(text0.indexOf('\n', 0) != -1)) {
var lines = text0.split('\n');
for (var i = 0;
- i < lines.length - 1; i++) {
- this.writeln(lines.$index(i));
+ $notnull_bool(i < lines.length - 1); i++) {
+ this.writeln($assert_String(lines.$index(i)));
}
- this.write(lines.$index(lines.length - 1));
+ this.write($assert_String(lines.$index(lines.length - 1)));
}
else {
this._buf.add(text0);
}
}
CodeWriter.prototype.writeln = function(text0) {
- if (text0 != null) {
+ if ($notnull_bool(text0 != null)) {
this.write(text0);
}
- if (!text0.endsWith('\n')) this._buf.add('\n'/*CodeWriter.NEWLINE*/);
+ if ($notnull_bool(!text0.endsWith('\n'))) this._buf.add('\n'/*CodeWriter.NEWLINE*/);
this._pendingIndent = true;
}
CodeWriter.prototype.enterBlock = function(text0) {
@@ -8195,7 +8385,7 @@ function WorldGenerator(main, writer) {
}
WorldGenerator.prototype.run = function() {
var metaGen = new MethodGenerator(this.main, null);
- var mainCall = this.main.invoke(metaGen, null, null, Arguments.get$EMPTY(), false);
+ var mainCall = this.main.invoke((metaGen && metaGen.is$MethodGenerator()), null, null, Arguments.get$EMPTY(), false);
this.main.declaringType.markUsed();
world.corelib.types.$index('BadNumberFormatException').markUsed();
world.get$coreimpl().types.$index('MatchImplementation').markUsed();
@@ -8204,7 +8394,7 @@ WorldGenerator.prototype.run = function() {
this.writeTypes(world.get$coreimpl());
this.writeTypes(world.corelib);
var matchConstructor = world.get$coreimpl().types.$index('MatchImplementation').getConstructor('');
- this.genMethod(matchConstructor);
+ this.genMethod((matchConstructor && matchConstructor.is$Member()));
matchConstructor.generator.writeDefinition(this.writer, null);
this.writeTypes(this.main.declaringType.get$library());
this._writeDynamicStubs(world.functionType);
@@ -8213,20 +8403,20 @@ WorldGenerator.prototype.run = function() {
}
WorldGenerator.prototype.globalForStaticField = function(field, fieldValue, dependencies) {
var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname() + "");
- if (!this.globals.containsKey(fullname)) {
+ if ($notnull_bool(!this.globals.containsKey(fullname))) {
this.globals.$setindex(fullname, GlobalValue.GlobalValue$fromStatic$factory(field, fieldValue, dependencies));
}
return this.globals.$index(fullname);
}
WorldGenerator.prototype.globalForConst = function(exp, dependencies) {
var code = exp.canonicalCode;
- if (!this.globals.containsKey(code)) {
+ if ($notnull_bool(!this.globals.containsKey(code))) {
this.globals.$setindex(code, GlobalValue.GlobalValue$fromConst$factory(this.globals.get$length(), exp, dependencies));
}
return this.globals.$index(code);
}
WorldGenerator.prototype.writeTypes = function(lib) {
- if (lib.isWritten) return;
+ if ($notnull_bool(lib.isWritten)) return;
lib.isWritten = true;
var $list = lib.imports;
for (var $i = 0;$i < $list.length; $i++) {
@@ -8234,7 +8424,7 @@ WorldGenerator.prototype.writeTypes = function(lib) {
this.writeTypes(import_.get$library());
}
for (var i = 0;
- i < lib.sources.length; i++) {
+ $notnull_bool(i < lib.sources.length); i++) {
lib.sources.$index(i).orderInLibrary = i;
}
this.writer.comment(('// ********** Library ' + lib.name + ' **************'));
@@ -8249,58 +8439,62 @@ WorldGenerator.prototype.writeTypes = function(lib) {
var $list = this._orderValues(lib.types);
for (var $i = 0;$i < $list.length; $i++) {
var type = $list.$index($i);
- if (type.get$isUsed() && type.get$isClass()) {
- this.writeType(type);
- if (type.get$isGeneric()) {
+ if ($notnull_bool(type.get$isUsed() && type.get$isClass())) {
+ this.writeType((type && type.is$lang_Type()));
+ if ($notnull_bool(type.get$isGeneric())) {
var $list0 = this._orderValues(type._concreteTypes);
for (var $i0 = 0;$i0 < $list0.length; $i0++) {
var ct = $list0.$index($i0);
- this.writeType(ct);
+ this.writeType((ct && ct.is$lang_Type()));
}
}
}
+ if ($notnull_bool(type.typeCheckCode != null)) {
+ this.writer.writeln(type.typeCheckCode);
+ }
}
}
WorldGenerator.prototype.genMethod = function(meth, enclosingMethod) {
- if (!meth.isGenerated && meth.declaringType.get$isClass() && $ne(meth.get$definition(), null) && !meth.get$isAbstract()) {
+ if ($notnull_bool(!meth.isGenerated && meth.declaringType.get$isClass() && $ne(meth.get$definition(), null) && !meth.get$isAbstract())) {
new MethodGenerator(meth, enclosingMethod).run();
}
}
WorldGenerator.prototype._maybeIsTest = function(onType, checkType) {
- if (!checkType.isTested) return;
+ if ($notnull_bool(!checkType.isTested)) return;
var value = 'false';
- if (onType.isSubtypeOf(checkType)) {
+ if ($notnull_bool(onType.isSubtypeOf(checkType))) {
value = 'function(){return this;}';
}
this.writer.writeln(('' + onType.get$jsname() + '.prototype.is\$' + checkType.get$jsname() + ' = ') + ('' + value + ';'));
}
WorldGenerator.prototype.writeType = function(type) {
- if (type.name != null && (type instanceof ConcreteType) && $eq(type.get$library(), world.get$coreimpl()) && type.name.startsWith('ListFactory')) {
+ var $0;
+ if ($notnull_bool(type.name != null && (type instanceof ConcreteType) && $eq(type.get$library(), world.get$coreimpl()) && type.name.startsWith('ListFactory'))) {
this.writer.writeln(('' + type.get$jsname() + ' = ' + type.get$genericType().get$jsname() + ';'));
return;
}
- var typeName = type.get$jsname() != null ? type.get$jsname() : 'top level';
+ var typeName = $notnull_bool(type.get$jsname() != null) ? type.get$jsname() : 'top level';
this.writer.comment(('// ********** Code for ' + typeName + ' **************'));
- if (type.get$isNativeType() && !type.get$isTop()) {
+ if ($notnull_bool(type.get$isNativeType() && !type.get$isTop())) {
var nativeName = type.get$definition().nativeType;
- if ($eq(nativeName, '')) {
+ if ($notnull_bool($eq(nativeName, ''))) {
this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
}
- else if (type.get$jsname() != nativeName) {
+ else if ($notnull_bool(type.get$jsname() != nativeName)) {
this.writer.writeln(('' + type.get$jsname() + ' = ' + nativeName + ';'));
}
}
- if (type.get$isTop()) {
+ if ($notnull_bool(type.get$isTop())) {
}
- else if (type.constructors.get$length() == 0) {
- if (!type.get$isNativeType()) {
+ else if ($notnull_bool(type.constructors.get$length() == 0)) {
+ if ($notnull_bool(!type.get$isNativeType())) {
this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
}
}
else {
var standardConstructor = type.constructors.$index('');
- if (standardConstructor == null || standardConstructor.generator == null) {
- if (!type.get$isNativeType()) {
+ if ($notnull_bool(standardConstructor == null || standardConstructor.generator == null)) {
+ if ($notnull_bool(!type.get$isNativeType())) {
this.writer.writeln(('function ' + type.get$jsname() + '() {}'));
}
}
@@ -8310,50 +8504,50 @@ WorldGenerator.prototype.writeType = function(type) {
var $list = type.constructors.getValues();
for (var $i = type.constructors.getValues().iterator(); $i.hasNext(); ) {
var c = $i.next();
- if ($ne(c.generator, null) && $ne(c, standardConstructor)) {
+ if ($notnull_bool($ne(c.generator, null) && $ne(c, standardConstructor))) {
c.generator.writeDefinition(this.writer, null);
}
}
}
- if (!type.get$isTop()) {
- if ((type instanceof ConcreteType)) {
+ if ($notnull_bool(!type.get$isTop())) {
+ if ($notnull_bool((type instanceof ConcreteType))) {
this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get$genericType().get$jsname() + ');'));
}
- else if (!type.get$isNativeType()) {
- if (type.get$parent() != null && !type.get$parent().get$isObject()) {
+ else if ($notnull_bool(!type.get$isNativeType())) {
+ if ($notnull_bool(type.get$parent() != null && !type.get$parent().get$isObject())) {
this.writer.writeln(('\$inherits(' + type.get$jsname() + ', ' + type.get$parent().get$jsname() + ');'));
}
}
}
- if (!(type instanceof ConcreteType)) {
+ if ($notnull_bool(!(type instanceof ConcreteType))) {
this._maybeIsTest(type, type);
}
- if (type.get$genericType()._concreteTypes != null) {
+ if ($notnull_bool(type.get$genericType()._concreteTypes != null)) {
var $list = this._orderValues(type.get$genericType()._concreteTypes);
for (var $i = 0;$i < $list.length; $i++) {
var ct = $list.$index($i);
- this._maybeIsTest(type, ct);
+ this._maybeIsTest(type, (ct && ct.is$lang_Type()));
}
}
- if (type.get$interfaces() != null) {
+ if ($notnull_bool(type.get$interfaces() != null)) {
var seen = new HashSetImplementation();
var worklist = [];
worklist.addAll(type.get$interfaces());
seen.addAll(type.get$interfaces());
- while (!worklist.isEmpty()) {
+ while ($notnull_bool(!worklist.isEmpty())) {
var interface_ = worklist.removeLast();
this._maybeIsTest(type, interface_.get$genericType());
- if (interface_.get$genericType()._concreteTypes != null) {
+ if ($notnull_bool(interface_.get$genericType()._concreteTypes != null)) {
var $list = this._orderValues(interface_.get$genericType()._concreteTypes);
for (var $i = 0;$i < $list.length; $i++) {
var ct = $list.$index($i);
- this._maybeIsTest(type, ct);
+ this._maybeIsTest(type, (ct && ct.is$lang_Type()));
}
}
var $list = interface_.get$interfaces();
for (var $i = 0;$i < $list.length; $i++) {
var other = $list.$index($i);
- if (!seen.contains(other)) {
+ if ($notnull_bool(!seen.contains(other))) {
worklist.addLast(other);
seen.add(other);
}
@@ -8361,23 +8555,23 @@ WorldGenerator.prototype.writeType = function(type) {
}
}
type.factories.forEach$1(this.get$_writeMethod());
- var $list = this._orderValues(type.members);
+ var $list = this._orderValues((($0 = type.members) && $0.is$Map()));
for (var $i = 0;$i < $list.length; $i++) {
var member = $list.$index($i);
- if ((member instanceof FieldMember)) {
- this._writeField(member);
+ if ($notnull_bool((member instanceof FieldMember))) {
+ this._writeField((member && member.is$FieldMember()));
}
- if ((member instanceof PropertyMember)) {
- this._writeProperty(member);
+ if ($notnull_bool((member instanceof PropertyMember))) {
+ this._writeProperty((member && member.is$PropertyMember()));
}
- if (member.get$isMethod()) {
- this._writeMethod(member);
+ if ($notnull_bool(member.get$isMethod())) {
+ this._writeMethod((member && member.is$Member()));
}
}
this._writeDynamicStubs(type);
}
WorldGenerator.prototype._writeDynamicStubs = function(type) {
- if (type.varStubs != null) {
+ if ($notnull_bool(type.varStubs != null)) {
var $list = orderValuesByKeys(type.varStubs);
for (var $i = 0;$i < $list.length; $i++) {
var stub = $list.$index($i);
@@ -8386,11 +8580,11 @@ WorldGenerator.prototype._writeDynamicStubs = function(type) {
}
}
WorldGenerator.prototype._writeStaticField = function(field) {
- if (field.isFinal) return;
+ if ($notnull_bool(field.isFinal)) return;
var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname() + "");
- if (this.globals.containsKey(fullname)) {
+ if ($notnull_bool(this.globals.containsKey(fullname))) {
var value = this.globals.$index(fullname);
- if (field.declaringType.get$isTop() && !field.isNative) {
+ if ($notnull_bool(field.declaringType.get$isTop() && !field.isNative)) {
this.writer.writeln(('var ' + field.get$jsname() + ' = ' + value.exp.code + ';'));
}
else {
@@ -8399,32 +8593,32 @@ WorldGenerator.prototype._writeStaticField = function(field) {
}
}
WorldGenerator.prototype._writeField = function(field) {
- if (field.declaringType.get$isTop() && !field.isNative && field.value == null) {
+ if ($notnull_bool(field.declaringType.get$isTop() && !field.isNative && field.value == null)) {
this.writer.writeln(('var ' + field.get$jsname() + ';'));
}
- if (field._providePropertySyntax) {
+ if ($notnull_bool(field._providePropertySyntax)) {
this.writer.writeln(('' + field.declaringType.get$jsname() + '.prototype.get\$' + field.get$jsname() + ' = ') + ('function() { return this.' + field.get$jsname() + '; };'));
- if (!field.isFinal) {
+ if ($notnull_bool(!field.isFinal)) {
this.writer.writeln(('' + field.declaringType.get$jsname() + '.prototype.set\$' + field.get$jsname() + ' = ') + ('function(value) { return this.' + field.get$jsname() + ' = value; };'));
}
}
}
WorldGenerator.prototype._writeProperty = function(property) {
- if (property.getter != null) this._writeMethod(property.getter);
- if (property.setter != null) this._writeMethod(property.setter);
- if (property._provideFieldSyntax) {
+ if ($notnull_bool(property.getter != null)) this._writeMethod(property.getter);
+ if ($notnull_bool(property.setter != null)) this._writeMethod(property.setter);
+ if ($notnull_bool(property._provideFieldSyntax)) {
this.writer.enterBlock('Object.defineProperty(' + ('' + property.declaringType.get$jsname() + '.prototype, "' + property.get$jsname() + '", {'));
- if (property.getter != null) {
+ if ($notnull_bool(property.getter != null)) {
this.writer.writeln(('get: ' + property.declaringType.get$jsname() + '.prototype.' + property.getter.get$jsname() + ','));
}
- if (property.setter != null) {
+ if ($notnull_bool(property.setter != null)) {
this.writer.writeln(('set: ' + property.declaringType.get$jsname() + '.prototype.' + property.setter.get$jsname() + ''));
}
this.writer.exitBlock('});');
}
}
WorldGenerator.prototype._writeMethod = function(method) {
- if (method.generator != null) {
+ if ($notnull_bool(method.generator != null)) {
method.generator.writeDefinition(this.writer, null);
}
}
@@ -8432,6 +8626,7 @@ WorldGenerator.prototype.get$_writeMethod = function() {
return WorldGenerator.prototype._writeMethod.bind(this);
}
WorldGenerator.prototype._writeGlobals = function() {
+ var $0;
var list = this.globals.getValues();
list.sort((function (a, b) {
return a.compareTo(b);
@@ -8439,7 +8634,7 @@ WorldGenerator.prototype._writeGlobals = function() {
);
for (var $i = list.iterator(); $i.hasNext(); ) {
var global = $i.next();
- if (global.field != null) {
+ if ($notnull_bool(global.field != null)) {
this._writeStaticField(global.field);
}
else {
@@ -8453,23 +8648,24 @@ WorldGenerator.prototype._orderValues = function(map0) {
return values;
}
WorldGenerator.prototype._compareMembers = function(x, y) {
- if (x.get$span() != null && y.get$span() != null) {
+ if ($notnull_bool(x.get$span() != null && y.get$span() != null)) {
var spans = x.get$span().compareTo(y.get$span());
- if (spans != 0) return spans;
+ if ($notnull_bool(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 x.get$name().compareTo(y.get$name());
}
WorldGenerator.prototype.get$_compareMembers = function() {
return WorldGenerator.prototype._compareMembers.bind(this);
}
WorldGenerator.prototype.useMapFactory = function() {
+ var $0;
var factType = world.get$coreimpl().types.$index('HashMapImplementation');
var m = factType.resolveMember('\$setindex');
- this.genMethod(m.members.$index(0));
+ this.genMethod((($0 = m.members.$index(0)) && $0.is$Member()));
var c = factType.getConstructor('');
- this.genMethod(c);
+ this.genMethod((c && c.is$Member()));
return factType;
}
// ********** Code for BlockScope **************
@@ -8479,11 +8675,11 @@ function BlockScope(enclosingMethod, parent, reentrant) {
this.reentrant = reentrant;
this._vars = $map([]);
// Initializers done
- if (this.get$isMethodScope()) {
+ if ($notnull_bool(this.get$isMethodScope())) {
this._closedOver = new HashSetImplementation$String();
}
else {
- this.reentrant = this.reentrant || this.parent.reentrant;
+ this.reentrant = $assert_bool(this.reentrant || this.parent.reentrant);
}
}
BlockScope.prototype.get$parent = function() { return this.parent; };
@@ -8493,19 +8689,19 @@ BlockScope.prototype.get$isMethodScope = function() {
}
BlockScope.prototype.get$methodScope = function() {
var s = this;
- while (!s.get$isMethodScope()) s = s.get$parent();
+ while ($notnull_bool(!s.get$isMethodScope())) s = s.get$parent();
return s;
}
BlockScope.prototype.lookup = function(name) {
var ret = this._vars.$index(name);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
for (var s = this.parent;
- $ne(s, null); s = s.get$parent()) {
+ $notnull_bool($ne(s, null)); s = s.get$parent()) {
ret = s._vars.$index(name);
- if ($ne(ret, null)) {
- if ($ne(s.enclosingMethod, this.enclosingMethod)) {
+ if ($notnull_bool($ne(ret, null))) {
+ if ($notnull_bool($ne(s.enclosingMethod, this.enclosingMethod))) {
s.get$methodScope()._closedOver.add(ret.code);
- if (this.enclosingMethod.captures != null && s.reentrant) {
+ if ($notnull_bool(this.enclosingMethod.captures != null && s.reentrant)) {
this.enclosingMethod.captures.add(ret.code);
}
}
@@ -8514,21 +8710,21 @@ BlockScope.prototype.lookup = function(name) {
}
}
BlockScope.prototype._isDefinedInParent = function(name) {
- if (this.get$isMethodScope() && this._closedOver.contains(name)) return true;
+ if ($notnull_bool(this.get$isMethodScope() && this._closedOver.contains(name))) return true;
for (var s = this.parent;
- $ne(s, null); s = s.get$parent()) {
- if (s._vars.containsKey(name)) return true;
- if (s.get$isMethodScope() && s._closedOver.contains(name)) return true;
+ $notnull_bool($ne(s, null)); s = s.get$parent()) {
+ if ($notnull_bool(s._vars.containsKey(name))) return true;
+ if ($notnull_bool(s.get$isMethodScope() && s._closedOver.contains(name))) return true;
}
var type = this.enclosingMethod.method.declaringType;
- if (type.resolveMember(name) != null) return true;
- if (type.get$library().lookup(name, null) != null) return true;
+ if ($notnull_bool(type.resolveMember(name) != null)) return true;
+ if ($notnull_bool(type.get$library().lookup(name, null) != null)) return true;
return false;
}
BlockScope.prototype.create = function(name, type, location) {
var jsName = world.toJsIdentifier(name);
- if (this._vars.containsKey(name)) {
- if (location != null) {
+ if ($notnull_bool(this._vars.containsKey(name))) {
+ if ($notnull_bool(location != null)) {
world.error(('duplicate name "' + name + '"'), location.span);
}
else {
@@ -8536,7 +8732,7 @@ BlockScope.prototype.create = function(name, type, location) {
}
}
var index = 0;
- while (this._isDefinedInParent(jsName)) {
+ while ($notnull_bool(this._isDefinedInParent($assert_String(jsName)))) {
jsName = ('' + name + '' + index++ + '');
}
var ret = new Value(type, jsName, false, false, false);
@@ -8545,35 +8741,37 @@ BlockScope.prototype.create = function(name, type, location) {
}
BlockScope.prototype.declare = function(id) {
var type = this.enclosingMethod.method.resolveType(id.type, false);
- return this.create(id.name.name, type, id);
+ return this.create(id.name.name, (type && type.is$lang_Type()), id);
}
BlockScope.prototype.getRethrow = function() {
var scope = this;
- while (scope.rethrow == null && $ne(scope.get$parent(), null)) {
+ while ($notnull_bool(scope.rethrow == null && $ne(scope.get$parent(), null))) {
scope = scope.get$parent();
}
return scope.rethrow;
}
// ********** Code for MethodGenerator **************
function MethodGenerator(method, enclosingMethod) {
+ var $0;
this.method = method;
this.enclosingMethod = enclosingMethod;
this.writer = new CodeWriter();
this.needsThis = false;
// Initializers done
- if (this.enclosingMethod != null) {
+ if ($notnull_bool(this.enclosingMethod != null)) {
this._scope = new BlockScope(this, this.enclosingMethod._scope, false);
this.captures = new HashSetImplementation();
}
else {
this._scope = new BlockScope(this, null, false);
}
- if (this.enclosingMethod != null && this.method.name != '') {
- this._scope.create(this.method.name, this.method.get$functionType(), this.method.get$definition());
+ if ($notnull_bool(this.enclosingMethod != null && this.method.name != '')) {
+ this._scope.create(this.method.name, this.method.get$functionType(), (($0 = this.method.get$definition()) && $0.is$lang_Node()));
}
this._usedTemps = new HashSetImplementation();
this._freeTemps = [];
}
+MethodGenerator.prototype.is$MethodGenerator = function(){return this;};
MethodGenerator.prototype.findMembers = function(name) {
return this.method.get$library()._findMembers(name);
}
@@ -8581,12 +8779,12 @@ MethodGenerator.prototype.get$isClosure = function() {
return (this.enclosingMethod != null);
}
MethodGenerator.prototype.getTemp = function(value) {
- return value.needsTemp ? this.forceTemp(value) : value;
+ return $notnull_bool(value.needsTemp) ? this.forceTemp(value) : value;
}
MethodGenerator.prototype.forceTemp = function(value) {
var name;
- if (this._freeTemps.length > 0) {
- name = this._freeTemps.removeLast();
+ if ($notnull_bool(this._freeTemps.length > 0)) {
+ name = $assert_String(this._freeTemps.removeLast());
}
else {
name = '\$' + this._usedTemps.get$length();
@@ -8595,7 +8793,7 @@ MethodGenerator.prototype.forceTemp = function(value) {
return new Value(value.type, name, false, false, false);
}
MethodGenerator.prototype.assignTemp = function(tmp, v) {
- if ($eq(tmp, v)) {
+ if ($notnull_bool($eq(tmp, v))) {
return v;
}
else {
@@ -8603,7 +8801,7 @@ MethodGenerator.prototype.assignTemp = function(tmp, v) {
}
}
MethodGenerator.prototype.freeTemp = function(value) {
- if (this._usedTemps.remove(value.code)) {
+ if ($notnull_bool(this._usedTemps.remove(value.code))) {
this._freeTemps.add(value.code);
}
else {
@@ -8611,11 +8809,11 @@ MethodGenerator.prototype.freeTemp = function(value) {
}
}
MethodGenerator.prototype.run = function() {
- if (this.method.isGenerated) return;
+ if ($notnull_bool(this.method.isGenerated)) return;
this.method.isGenerated = true;
this.method.generator = this;
- if ((this.method.get$definition().body instanceof NativeStatement)) {
- if (this.method.get$definition().body.body == null) {
+ if ($notnull_bool((this.method.get$definition().body instanceof NativeStatement))) {
+ if ($notnull_bool(this.method.get$definition().body.body == null)) {
this.method.generator = null;
}
else {
@@ -8623,7 +8821,7 @@ MethodGenerator.prototype.run = function() {
return p.get$name();
})
);
- this.writer.write(this.method.get$definition().body.body);
+ this.writer.write($assert_String(this.method.get$definition().body.body));
}
}
else {
@@ -8633,26 +8831,26 @@ MethodGenerator.prototype.run = function() {
MethodGenerator.prototype.writeDefinition = function(defWriter, lambda) {
var paramCode = this._paramCode;
var names = null;
- if (this.captures != null && this.captures.get$length() > 0) {
+ if ($notnull_bool(this.captures != null && this.captures.get$length() > 0)) {
names = ListFactory.ListFactory$from$factory(this.captures);
names.sort((function (x, y) {
return x.compareTo(y);
})
);
- paramCode = ListFactory.ListFactory$from$factory(names);
+ paramCode = ListFactory.ListFactory$from$factory((names && names.is$Iterable()));
paramCode.addAll(this._paramCode);
}
var _params = ('(' + Strings.join(this._paramCode, ", ") + ')');
- var params = ('(' + Strings.join(paramCode, ", ") + ')');
- if (this.method.declaringType.get$isTop() && !this.get$isClosure()) {
+ var params = ('(' + Strings.join((paramCode && paramCode.is$List$String()), ", ") + ')');
+ if ($notnull_bool(this.method.declaringType.get$isTop() && !this.get$isClosure())) {
defWriter.enterBlock(('function ' + this.method.get$jsname() + '' + params + ' {'));
}
- else if (this.get$isClosure()) {
- if (this.method.name == '') {
+ else if ($notnull_bool(this.get$isClosure())) {
+ if ($notnull_bool(this.method.name == '')) {
defWriter.enterBlock(('(function ' + params + ' {'));
}
- else if ($ne(names, null)) {
- if (lambda == null) {
+ else if ($notnull_bool($ne(names, null))) {
+ if ($notnull_bool(lambda == null)) {
defWriter.enterBlock(('var ' + this.method.get$jsname() + ' = (function' + params + ' {'));
}
else {
@@ -8663,27 +8861,28 @@ MethodGenerator.prototype.writeDefinition = function(defWriter, lambda) {
defWriter.enterBlock(('function ' + this.method.get$jsname() + '' + params + ' {'));
}
}
- else if (this.method.get$isConstructor()) {
- if (this.method.get$constructorName() == '') {
+ else if ($notnull_bool(this.method.get$isConstructor())) {
+ if ($notnull_bool(this.method.get$constructorName() == '')) {
defWriter.enterBlock(('function ' + this.method.declaringType.get$jsname() + '' + params + ' {'));
}
else {
defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + this.method.get$constructorName() + '\$ctor = function' + params + ' {'));
}
}
- else if (this.method.get$isFactory()) {
+ else if ($notnull_bool(this.method.get$isFactory())) {
defWriter.enterBlock(('' + this.method.get$generatedFactoryName() + ' = function' + _params + ' {'));
}
- else if (this.method.get$isStatic()) {
+ else if ($notnull_bool(this.method.get$isStatic())) {
defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.' + this.method.get$jsname() + ' = function' + _params + ' {'));
}
else {
defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.prototype.') + ('' + this.method.get$jsname() + ' = function' + _params + ' {'));
}
- if (this.needsThis) {
+ if ($notnull_bool(this.needsThis)) {
defWriter.writeln('var \$this = this; // closure support');
}
- if (this._usedTemps.get$length() > 0 || this._freeTemps.length > 0) {
+ if ($notnull_bool(this._usedTemps.get$length() > 0 || this._freeTemps.length > 0)) {
+ $assert(this._usedTemps.get$length() == 0, "_usedTemps.length == 0", "gen.dart", 651, 14);
this._freeTemps.addAll(this._usedTemps);
this._freeTemps.sort((function (x, y) {
return x.compareTo(y);
@@ -8692,45 +8891,45 @@ MethodGenerator.prototype.writeDefinition = function(defWriter, lambda) {
defWriter.writeln(('var ' + Strings.join(this._freeTemps, ", ") + ';'));
}
defWriter.writeln(this.writer.get$text());
- if ($ne(names, null)) {
- defWriter.exitBlock(('}).bind(null, ' + Strings.join(names, ", ") + ')'));
+ if ($notnull_bool($ne(names, null))) {
+ defWriter.exitBlock(('}).bind(null, ' + Strings.join((names && names.is$List$String()), ", ") + ')'));
}
- else if (this.get$isClosure() && this.method.name == '') {
+ else if ($notnull_bool(this.get$isClosure() && this.method.name == '')) {
defWriter.exitBlock('})');
}
else {
defWriter.exitBlock('}');
}
- if (this.method.get$isConstructor() && this.method.get$constructorName() != '') {
+ if ($notnull_bool(this.method.get$isConstructor() && this.method.get$constructorName() != '')) {
defWriter.writeln(('' + this.method.declaringType.get$jsname() + '.' + this.method.get$constructorName() + '\$ctor.prototype = ') + ('' + this.method.declaringType.get$jsname() + '.prototype;'));
}
this._provideOptionalParamInfo(defWriter);
- if ((this.method instanceof MethodMember) && this.method._providePropertySyntax) {
+ if ($notnull_bool((this.method instanceof MethodMember) && this.method._providePropertySyntax)) {
defWriter.enterBlock(('' + this.method.declaringType.get$jsname() + '.prototype.get\$' + this.method.get$jsname() + ' = function() {'));
defWriter.writeln(('return ' + this.method.declaringType.get$jsname() + '.prototype.' + this.method.get$jsname() + '.bind(this);'));
defWriter.exitBlock('}');
- if (this.method._provideFieldSyntax) {
+ if ($notnull_bool(this.method._provideFieldSyntax)) {
world.internalError('bound method accessed with field syntax');
}
}
}
MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) {
- if ((this.method instanceof MethodMember) && this.method._provideOptionalParamInfo) {
+ if ($notnull_bool((this.method instanceof MethodMember) && this.method._provideOptionalParamInfo)) {
var optNames = [];
var optValues = [];
this.method.genParameterValues();
var $list = this.method.get$parameters();
for (var $i = 0;$i < $list.length; $i++) {
var param = $list.$index($i);
- if (param.get$isOptional()) {
+ if ($notnull_bool(param.get$isOptional())) {
optNames.add(param.get$name());
optValues.add(MethodGenerator._escapeString(param.get$value().code));
}
}
- if (optNames.length > 0) {
+ if ($notnull_bool(optNames.length > 0)) {
var start = '';
- if (this.method.get$isStatic()) {
- if (!this.method.declaringType.get$isTop()) {
+ if ($notnull_bool(this.method.get$isStatic())) {
+ if ($notnull_bool(!this.method.declaringType.get$isTop())) {
start = this.method.declaringType.get$jsname() + '.';
}
}
@@ -8738,23 +8937,24 @@ MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) {
start = this.method.declaringType.get$jsname() + '.prototype.';
}
optNames.addAll(optValues);
- var optional = "['" + Strings.join(optNames, "', '") + "']";
+ var optional = "['" + Strings.join((optNames && optNames.is$List$String()), "', '") + "']";
defWriter.writeln(('' + start + '' + this.method.get$jsname() + '.\$optional = ' + optional + ''));
}
}
}
MethodGenerator.prototype.writeBody = function() {
+ var $0;
var initializers = null;
var initializedFields = null;
- if (this.method.get$isConstructor()) {
+ if ($notnull_bool(this.method.get$isConstructor())) {
initializers = [];
initializedFields = new HashSetImplementation();
var $list = world.gen._orderValues(this.method.declaringType.getAllMembers());
for (var $i = 0;$i < $list.length; $i++) {
var f = $list.$index($i);
- if ((f instanceof FieldMember) && !f.get$isStatic()) {
+ if ($notnull_bool((f instanceof FieldMember) && !f.get$isStatic())) {
var cv = f.computeValue();
- if ($ne(cv, null)) {
+ if ($notnull_bool($ne(cv, null))) {
initializers.add(('this.' + f.get$jsname() + ' = ' + cv.code + ''));
initializedFields.add(f.get$name());
}
@@ -8765,13 +8965,13 @@ MethodGenerator.prototype.writeBody = function() {
var $list = this.method.get$parameters();
for (var $i = 0;$i < $list.length; $i++) {
var p = $list.$index($i);
- if ($ne(initializers, null) && p.get$name().startsWith('this.')) {
+ if ($notnull_bool($ne(initializers, null) && p.get$name().startsWith('this.'))) {
var name = p.get$name().substring(5);
var field = this.method.declaringType.getMember(name);
- if (field == null) {
+ if ($notnull_bool(field == null)) {
world.error('bad this parameter - no matching field', p.get$definition().get$span());
}
- if (!field.get$isField()) {
+ if ($notnull_bool(!field.get$isField())) {
world.error(('"' + p.get$name() + '" does not refer to a field'), p.get$definition().get$span());
}
var paramValue = new Value(field.get$returnType(), name, false, false, false);
@@ -8780,33 +8980,33 @@ MethodGenerator.prototype.writeBody = function() {
initializedFields.add(name);
}
else {
- var paramValue = this._scope.create(p.get$name(), p.type, p.get$definition());
+ var paramValue = this._scope.create($assert_String(p.get$name()), (($0 = p.type) && $0.is$lang_Type()), (($0 = p.get$definition()) && $0.is$lang_Node()));
this._paramCode.add(paramValue.code);
}
}
var body = this.method.get$definition().body;
- if (body == null && !this.method.get$isConstructor()) {
+ if ($notnull_bool(body == null && !this.method.get$isConstructor())) {
world.error(('unexpected empty body for ' + this.method.name + ''), this.method.get$definition().get$span());
}
- if ($ne(initializers, null)) {
+ if ($notnull_bool($ne(initializers, null))) {
for (var $i = initializers.iterator(); $i.hasNext(); ) {
var i = $i.next();
- this.writer.writeln(i);
+ this.writer.writeln($assert_String(i));
}
var declaredInitializers = this.method.get$definition().initializers;
- if (declaredInitializers != null) {
+ if ($notnull_bool(declaredInitializers != null)) {
var initializerCall = null;
for (var $i = 0;$i < declaredInitializers.length; $i++) {
var init = declaredInitializers.$index($i);
- if ((init instanceof CallExpression)) {
- if ($ne(initializerCall, null)) {
+ if ($notnull_bool((init instanceof CallExpression))) {
+ if ($notnull_bool($ne(initializerCall, null))) {
world.error('only one initializer redirecting call is allowed', init.get$span());
}
initializerCall = init;
}
- else if ((init instanceof BinaryExpression) && TokenKind.kindFromAssign(init.op.kind) == 0) {
+ else if ($notnull_bool((init instanceof BinaryExpression) && TokenKind.kindFromAssign(init.op.kind) == 0)) {
var left = init.x;
- if (!((left instanceof DotExpression) && (left.self instanceof ThisExpression) || (left instanceof VarExpression))) {
+ if ($notnull_bool(!((left instanceof DotExpression) && (left.self instanceof ThisExpression) || (left instanceof VarExpression)))) {
world.error('invalid left side of initializer', left.get$span());
continue;
}
@@ -8818,21 +9018,21 @@ MethodGenerator.prototype.writeBody = function() {
world.error('invalid initializer', init.get$span());
}
}
- if ($ne(initializerCall, null)) {
- var target = this._writeInitializerCall(initializerCall);
- if (!target.isSuper) {
- if (initializers.length > 0) {
+ if ($notnull_bool($ne(initializerCall, null))) {
+ var target = this._writeInitializerCall((initializerCall && initializerCall.is$CallExpression()));
+ if ($notnull_bool(!target.isSuper)) {
+ if ($notnull_bool(initializers.length > 0)) {
var $list = this.method.get$parameters();
for (var $i = 0;$i < $list.length; $i++) {
var p = $list.$index($i);
- if (p.get$name().startsWith('this.')) {
+ if ($notnull_bool(p.get$name().startsWith('this.'))) {
world.error('no initialization allowed on redirecting constructors', p.get$definition().get$span());
break;
}
}
}
- if (declaredInitializers.length > 1) {
- var init = $eq(declaredInitializers.$index(0), initializerCall) ? declaredInitializers.$index(1) : declaredInitializers.$index(0);
+ if ($notnull_bool(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());
}
initializedFields = null;
@@ -8843,32 +9043,32 @@ MethodGenerator.prototype.writeBody = function() {
}
this.writer.comment('// Initializers done');
}
- if ($ne(initializedFields, null)) {
+ if ($notnull_bool($ne(initializedFields, null))) {
var $list = this.method.declaringType.members.getKeys();
for (var $i = this.method.declaringType.members.getKeys().iterator(); $i.hasNext(); ) {
var name = $i.next();
var member = this.method.declaringType.members.$index(name);
- if ((member instanceof FieldMember) && member.isFinal && !member.get$isStatic() && !initializedFields.contains(name)) {
+ if ($notnull_bool((member instanceof FieldMember) && member.isFinal && !member.get$isStatic() && !initializedFields.contains(name))) {
world.error(('Field "' + name + '" is final and was not initialized'), this.method.get$definition().get$span());
}
}
}
- this.visitStatementsInBlock(body);
+ this.visitStatementsInBlock((body && body.is$lang_Statement()));
}
MethodGenerator.prototype._writeInitializerCall = function(node) {
var contructorName = '';
var targetExp = node.target;
- if ((targetExp instanceof DotExpression)) {
+ if ($notnull_bool((targetExp instanceof DotExpression))) {
var dot = targetExp;
targetExp = dot.self;
contructorName = dot.name.name;
}
var target = null;
- if ((targetExp instanceof SuperExpression)) {
- target = this._makeSuperValue(targetExp);
+ if ($notnull_bool((targetExp instanceof SuperExpression))) {
+ target = this._makeSuperValue((targetExp && targetExp.is$lang_Node()));
}
- else if ((targetExp instanceof ThisExpression)) {
- target = this._makeThisValue(targetExp);
+ else if ($notnull_bool((targetExp instanceof ThisExpression))) {
+ target = this._makeThisValue((targetExp && targetExp.is$lang_Node()));
}
else {
world.error('bad call in initializers', node.span);
@@ -8876,32 +9076,33 @@ MethodGenerator.prototype._writeInitializerCall = function(node) {
var m = target.type.getConstructor(contructorName);
this.method.set$initDelegate(m);
var other = m;
- while ($ne(other, null)) {
- if ($eq(other, this.method)) {
+ while ($notnull_bool($ne(other, null))) {
+ if ($notnull_bool($eq(other, this.method))) {
world.error('initialization cycle', node.span);
break;
}
other = other.get$initDelegate();
}
- world.gen.genMethod(m);
+ world.gen.genMethod((m && m.is$Member()));
var value = m.invoke$4(this, node, target, this._makeArgs(node.arguments));
- if ($ne(target.type, world.objectType)) {
+ if ($notnull_bool($ne(target.type, world.objectType))) {
this.writer.writeln(('' + value.code + ';'));
}
return target;
}
MethodGenerator.prototype._makeArgs = function(arguments) {
+ var $0;
var args = [];
var seenLabel = false;
for (var $i = 0;$i < arguments.length; $i++) {
var arg = arguments.$index($i);
- if (arg.label != null) {
+ if ($notnull_bool(arg.label != null)) {
seenLabel = true;
}
- else if (seenLabel) {
+ else if ($notnull_bool(seenLabel)) {
world.error('bare argument can not follow named arguments', arg.get$span());
}
- args.add(this.visitValue(arg.get$value()));
+ args.add(this.visitValue((($0 = arg.get$value()) && $0.is$lang_Expression())));
}
return new Arguments(arguments, args);
}
@@ -8909,7 +9110,8 @@ MethodGenerator._escapeString = function(text) {
return text.replaceAll('\\', '\\\\').replaceAll('"', '\\"').replaceAll('\n', '\\n').replaceAll('\r', '\\r');
}
MethodGenerator.prototype.visitStatementsInBlock = function(body) {
- if ((body instanceof BlockStatement)) {
+ var $0;
+ if ($notnull_bool((body instanceof BlockStatement))) {
var $list = body.body;
for (var $i = body.body.iterator(); $i.hasNext(); ) {
var stmt = $i.next();
@@ -8917,7 +9119,7 @@ MethodGenerator.prototype.visitStatementsInBlock = function(body) {
}
}
else {
- if (body != null) body.visit(this);
+ if ($notnull_bool(body != null)) body.visit(this);
}
return false;
}
@@ -8931,14 +9133,14 @@ MethodGenerator.prototype._makeLambdaMethod = function(name, func) {
var meth = new MethodMember(name, this.method.declaringType, func);
meth.isLambda = true;
meth.resolve(this.method.declaringType);
- world.gen.genMethod(meth, this);
+ world.gen.genMethod((meth && meth.is$Member()), this);
return meth;
}
MethodGenerator.prototype.visitBool = function(node) {
- return this.visitTypedValue(node, world.boolType);
+ return this.visitValue(node).convertToNonNullBool(this, node);
}
MethodGenerator.prototype.visitValue = function(node) {
- if (node == null) return null;
+ if ($notnull_bool(node == null)) return null;
var value = node.visit(this);
value.checkFirstClass(node.span);
return value;
@@ -8947,43 +9149,45 @@ MethodGenerator.prototype.visitTypedValue = function(node, expectedType) {
return this.visitValue(node).convertTo(this, expectedType, node, false);
}
MethodGenerator.prototype.visitVoid = function(node) {
- if ((node instanceof PostfixExpression)) {
- var value = this.visitPostfixExpression(node, true);
+ if ($notnull_bool((node instanceof PostfixExpression))) {
+ var value = this.visitPostfixExpression((node && node.is$PostfixExpression()), true);
value.checkFirstClass(node.span);
return value;
}
return this.visitValue(node);
}
MethodGenerator.prototype.visitDietStatement = function(node) {
+ var $0;
var parser = new lang_Parser(node.span.file, false, node.span.start);
- this.visitStatementsInBlock(parser.block());
+ this.visitStatementsInBlock((($0 = parser.block()) && $0.is$lang_Statement()));
return false;
}
MethodGenerator.prototype.visitVariableDefinition = function(node) {
+ var $0;
var isFinal = false;
- if (node.modifiers != null && node.modifiers.$index(0).kind == 96/*TokenKind.FINAL*/) {
+ if ($notnull_bool(node.modifiers != null && node.modifiers.$index(0).kind == 97/*TokenKind.FINAL*/)) {
isFinal = true;
}
this.writer.write('var ');
var type = this.method.resolveType(node.type, false);
for (var i = 0;
- i < node.names.length; i++) {
+ $notnull_bool(i < node.names.length); i++) {
var thisType = type;
- if (i > 0) {
+ if ($notnull_bool(i > 0)) {
this.writer.write(', ');
}
var name = node.names.$index(i).get$name();
- var value = this.visitValue(node.values.$index(i));
- if (isFinal) {
- if (value == null) {
+ var value = this.visitValue((($0 = node.values.$index(i)) && $0.is$lang_Expression()));
+ if ($notnull_bool(isFinal)) {
+ if ($notnull_bool(value == null)) {
world.error('no value specified for final variable', node.span);
}
else {
- if (thisType.get$isVar()) thisType = value.type;
+ if ($notnull_bool(thisType.get$isVar())) thisType = value.type;
}
}
- var val = this._scope.create(name, thisType, node.names.$index(i));
- if (value == null) {
+ var val = this._scope.create($assert_String(name), (thisType && thisType.is$lang_Type()), (($0 = node.names.$index(i)) && $0.is$lang_Node()));
+ if ($notnull_bool(value == null)) {
this.writer.write(('' + val.code + ''));
}
else {
@@ -8994,18 +9198,19 @@ MethodGenerator.prototype.visitVariableDefinition = function(node) {
return false;
}
MethodGenerator.prototype.visitFunctionDefinition = function(node) {
+ var $0;
var name = world.toJsIdentifier(node.name.name);
- var meth = this._makeLambdaMethod(name, node);
- var funcValue = this._scope.create(name, meth.get$functionType(), this.method.get$definition());
+ var meth = this._makeLambdaMethod($assert_String(name), node);
+ var funcValue = this._scope.create($assert_String(name), meth.get$functionType(), (($0 = this.method.get$definition()) && $0.is$lang_Node()));
meth.generator.writeDefinition(this.writer, null);
return false;
}
MethodGenerator.prototype.visitReturnStatement = function(node) {
- if (node.value == null) {
+ if ($notnull_bool(node.value == null)) {
this.writer.writeln('return;');
}
else {
- if (this.method.get$isConstructor()) {
+ if ($notnull_bool(this.method.get$isConstructor())) {
world.error('return of value not allowed from constructor', node.span);
}
this.writer.writeln(('return ' + this.visitValue(node.value).code + ';'));
@@ -9013,14 +9218,14 @@ MethodGenerator.prototype.visitReturnStatement = function(node) {
return true;
}
MethodGenerator.prototype.visitThrowStatement = function(node) {
- if (node.value != null) {
+ if ($notnull_bool(node.value != null)) {
var value = this.visitValue(node.value);
value.invoke$4(this, 'toString', node, Arguments.get$EMPTY());
this.writer.writeln(('\$throw(' + value.code + ');'));
}
else {
var rethrow = this._scope.getRethrow();
- if (rethrow == null) {
+ if ($notnull_bool(rethrow == null)) {
world.error('rethrow outside of catch', node.span);
}
else {
@@ -9030,20 +9235,21 @@ MethodGenerator.prototype.visitThrowStatement = function(node) {
return true;
}
MethodGenerator.prototype.visitAssertStatement = function(node) {
+ var $0;
var test = this.visitValue(node.test);
- if (options.enableAsserts) {
+ if ($notnull_bool(options.enableAsserts)) {
var err = world.corelib.types.$index('AssertError');
- world.gen.genMethod(err.getConstructor(''));
- world.gen.genMethod(err.members.$index('toString'));
+ world.gen.genMethod((($0 = err.getConstructor('')) && $0.is$Member()));
+ world.gen.genMethod((($0 = err.members.$index('toString')) && $0.is$Member()));
var span = node.test.span;
var line = span.file.getLine(span.start);
- var column = span.file.getColumn(line, span.start);
+ var column = span.file.getColumn($assert_num(line), span.start);
this.writer.writeln(('\$assert(' + test.code + ', "' + MethodGenerator._escapeString(span.get$text()) + '",') + (' "' + span.file.filename + '", ' + (line + 1) + ', ' + (column + 1) + ');'));
}
return false;
}
MethodGenerator.prototype.visitBreakStatement = function(node) {
- if (node.label == null) {
+ if ($notnull_bool(node.label == null)) {
this.writer.writeln('break;');
}
else {
@@ -9052,7 +9258,7 @@ MethodGenerator.prototype.visitBreakStatement = function(node) {
return true;
}
MethodGenerator.prototype.visitContinueStatement = function(node) {
- if (node.label == null) {
+ if ($notnull_bool(node.label == null)) {
this.writer.writeln('continue;');
}
else {
@@ -9064,9 +9270,9 @@ MethodGenerator.prototype.visitIfStatement = function(node) {
var test = this.visitBool(node.test);
this.writer.write(('if (' + test.code + ') '));
var exit1 = node.trueBranch.visit(this);
- if (node.falseBranch != null) {
+ if ($notnull_bool(node.falseBranch != null)) {
this.writer.write('else ');
- if (node.falseBranch.visit(this) && exit1) {
+ if ($notnull_bool(node.falseBranch.visit(this) && exit1)) {
return true;
}
}
@@ -9092,9 +9298,9 @@ MethodGenerator.prototype.visitDoStatement = function(node) {
MethodGenerator.prototype.visitForStatement = function(node) {
this._pushBlock(false);
this.writer.write('for (');
- if (node.init != null) node.init.visit(this);
+ if ($notnull_bool(node.init != null)) node.init.visit(this);
else this.writer.write(';');
- if (node.test != null) {
+ if ($notnull_bool(node.test != null)) {
var test = this.visitBool(node.test);
this.writer.write((' ' + test.code + '; '));
}
@@ -9105,8 +9311,8 @@ MethodGenerator.prototype.visitForStatement = function(node) {
var $list = node.step;
for (var $i = 0;$i < $list.length; $i++) {
var s = $list.$index($i);
- if (needsComma) this.writer.write(', ');
- var sv = this.visitVoid(s);
+ if ($notnull_bool(needsComma)) this.writer.write(', ');
+ var sv = this.visitVoid((s && s.is$lang_Expression()));
this.writer.write(sv.code);
needsComma = true;
}
@@ -9118,17 +9324,18 @@ MethodGenerator.prototype.visitForStatement = function(node) {
return false;
}
MethodGenerator.prototype.visitForInStatement = function(node) {
+ var $0;
var itemType = this.method.resolveType(node.item.type, false);
var itemName = node.item.name.name;
var list = node.list.visit(this);
this._pushBlock(true);
- var item = this._scope.create(itemName, itemType, node.item.name);
+ var item = this._scope.create($assert_String(itemName), (itemType && itemType.is$lang_Type()), node.item.name);
var listVar = list;
- if (list.needsTemp) {
- listVar = this._scope.create('\$list', list.type, null);
+ if ($notnull_bool(list.needsTemp)) {
+ listVar = this._scope.create('\$list', (($0 = list.type) && $0.is$lang_Type()), null);
this.writer.writeln(('var ' + listVar.code + ' = ' + list.code + ';'));
}
- if (list.type.get$isList()) {
+ if ($notnull_bool(list.type.get$isList())) {
var tmpi = this._scope.create('\$i', world.numType, null);
this.writer.enterBlock(('for (var ' + tmpi.code + ' = 0;') + ('' + tmpi.code + ' < ' + listVar.code + '.length; ' + tmpi.code + '++) {'));
var value = listVar.invoke(this, '\$index', node.list, new Arguments(null, [tmpi]), false);
@@ -9139,7 +9346,7 @@ MethodGenerator.prototype.visitForInStatement = function(node) {
var c = world.get$coreimpl().types.$index('ListIterator').getConstructor('');
c.invoke$4(this, node, null, new Arguments(null, [new Value(null, 'l', false, true, false)]));
var iterator = list.invoke$4(this, 'iterator', node.list, Arguments.get$EMPTY());
- var tmpi = this._scope.create('\$i', iterator.type, null);
+ var tmpi = this._scope.create('\$i', (($0 = iterator.type) && $0.is$lang_Type()), null);
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 + '; ) {'));
@@ -9151,7 +9358,8 @@ MethodGenerator.prototype.visitForInStatement = function(node) {
return false;
}
MethodGenerator.prototype._genToDartException = function(ex) {
- var types = const$392/*const [
+ var $0;
+ var types = const$393/*const [
'NullPointerException', 'ObjectNotClosureException',
'NoSuchMethodException', 'StackOverflowException']*/;
for (var $i = types.iterator(); $i.hasNext(); ) {
@@ -9161,86 +9369,87 @@ MethodGenerator.prototype._genToDartException = function(ex) {
this.writer.writeln(('' + ex + ' = \$toDartException(' + ex + ');'));
}
MethodGenerator.prototype.visitTryStatement = function(node) {
+ var $0;
this.writer.enterBlock('try {');
this._pushBlock(false);
this.visitStatementsInBlock(node.body);
this._popBlock();
- if (node.catches.length == 1) {
+ if ($notnull_bool(node.catches.length == 1)) {
var catch_ = node.catches.$index(0);
this._pushBlock(false);
- var ex = this._scope.declare(catch_.get$exception());
- this._scope.rethrow = ex;
+ 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) {
+ if ($notnull_bool(catch_.trace != null)) {
var trace = this._scope.declare(catch_.trace);
this.writer.writeln(('var ' + trace.code + ' = \$stackTraceOf(' + ex.code + ');'));
}
this._genToDartException(ex.code);
- if (!ex.type.get$isVar()) {
- var test = ex.instanceOf(this, ex.type, catch_.get$exception().get$span(), false, true);
+ if ($notnull_bool(!ex.type.get$isVar())) {
+ var test = ex.instanceOf(this, (($0 = ex.type) && $0.is$lang_Type()), catch_.get$exception().get$span(), false, true);
this.writer.writeln(('if (' + test.code + ') throw ' + ex.code + ';'));
}
- this.visitStatementsInBlock(node.catches.$index(0).body);
+ this.visitStatementsInBlock((($0 = node.catches.$index(0).body) && $0.is$lang_Statement()));
this._popBlock();
}
- else if (node.catches.length > 0) {
+ else if ($notnull_bool(node.catches.length > 0)) {
this._pushBlock(false);
var ex = this._scope.create('\$ex', world.varType, null);
- this._scope.rethrow = ex;
+ this._scope.rethrow = (ex && ex.is$Value());
this.writer.nextBlock(('} catch (' + ex.code + ') {'));
var trace = null;
- if (node.catches.some((function (c) {
+ if ($notnull_bool(node.catches.some((function (c) {
return c.trace != null;
})
- )) {
+ ))) {
trace = this._scope.create('\$trace', world.varType, null);
this.writer.writeln(('var ' + trace.code + ' = \$stackTraceOf(' + ex.code + ');'));
}
this._genToDartException(ex.code);
var needsRethrow = true;
for (var i = 0;
- i < node.catches.length; i++) {
+ $notnull_bool(i < node.catches.length); i++) {
var catch_ = node.catches.$index(i);
this._pushBlock(false);
- var tmp = this._scope.declare(catch_.get$exception());
- if (!tmp.type.get$isVar()) {
- var test = ex.instanceOf(this, tmp.type, catch_.get$exception().get$span(), true, true);
- if (i == 0) {
+ var tmp = this._scope.declare((($0 = catch_.get$exception()) && $0.is$DeclaredIdentifier()));
+ if ($notnull_bool(!tmp.type.get$isVar())) {
+ var test = ex.instanceOf(this, (($0 = tmp.type) && $0.is$lang_Type()), catch_.get$exception().get$span(), true, true);
+ if ($notnull_bool(i == 0)) {
this.writer.enterBlock(('if (' + test.code + ') {'));
}
else {
this.writer.nextBlock(('} else if (' + test.code + ') {'));
}
}
- else if (i > 0) {
+ else if ($notnull_bool(i > 0)) {
this.writer.nextBlock('} else {');
}
this.writer.writeln(('var ' + tmp.code + ' = ' + ex.code + ';'));
- if (catch_.trace != null) {
+ if ($notnull_bool(catch_.trace != null)) {
var tmptrace = this._scope.declare(catch_.trace);
this.writer.writeln(('var ' + tmptrace.code + ' = ' + trace.code + ';'));
}
- this.visitStatementsInBlock(catch_.body);
+ this.visitStatementsInBlock((($0 = catch_.body) && $0.is$lang_Statement()));
this._popBlock();
- if (tmp.type.get$isVar()) {
- if (i + 1 < node.catches.length) {
- world.warning('Unreachable catch clause', node.catches.$index(i + 1));
+ if ($notnull_bool(tmp.type.get$isVar())) {
+ if ($notnull_bool(i + 1 < node.catches.length)) {
+ world.warning('Unreachable catch clause', (($0 = node.catches.$index(i + 1)) && $0.is$SourceSpan()));
}
- if (i > 0) {
+ if ($notnull_bool(i > 0)) {
this.writer.exitBlock('}');
}
needsRethrow = false;
break;
}
}
- if (needsRethrow) {
+ if ($notnull_bool(needsRethrow)) {
this.writer.nextBlock('} else {');
this.writer.writeln(('throw ' + ex.code + ';'));
this.writer.exitBlock('}');
}
this._popBlock();
}
- if (node.finallyBlock != null) {
+ if ($notnull_bool(node.finallyBlock != null)) {
this.writer.nextBlock('} finally {');
this._pushBlock(false);
this.visitStatementsInBlock(node.finallyBlock);
@@ -9255,27 +9464,27 @@ MethodGenerator.prototype.visitSwitchStatement = function(node) {
var $list = node.cases;
for (var $i = 0;$i < $list.length; $i++) {
var case_ = $list.$index($i);
- if (case_.label != null) {
+ if ($notnull_bool(case_.label != null)) {
world.error('unimplemented: labeled case statement', case_.get$span());
}
this._pushBlock(false);
for (var i = 0;
- i < case_.cases.length; i++) {
+ $notnull_bool(i < case_.cases.length); i++) {
var expr = case_.cases.$index(i);
- if (expr == null) {
- if (i < case_.cases.length - 1) {
+ if ($notnull_bool(expr == null)) {
+ if ($notnull_bool(i < case_.cases.length - 1)) {
world.error('default clause must be the last case', case_.get$span());
}
this.writer.writeln('default:');
}
else {
- var value = this.visitValue(expr);
+ var value = this.visitValue((expr && expr.is$lang_Expression()));
this.writer.writeln(('case ' + value.code + ':'));
}
}
this.writer.enterBlock('');
var caseExits = this._visitAllStatements(case_.statements, false);
- if ($ne(case_, node.cases.$index(node.cases.length - 1)) && !caseExits) {
+ if ($notnull_bool($ne(case_, node.cases.$index(node.cases.length - 1)) && !caseExits)) {
var span = case_.statements.$index(case_.statements.length - 1).get$span();
this.writer.writeln('\$throw(new FallThroughError());');
}
@@ -9287,10 +9496,10 @@ MethodGenerator.prototype.visitSwitchStatement = function(node) {
}
MethodGenerator.prototype._visitAllStatements = function(statementList, exits) {
for (var i = 0;
- i < statementList.length; i++) {
+ $notnull_bool(i < statementList.length); i++) {
var stmt = statementList.$index(i);
exits = stmt.visit(this);
- if ($ne(stmt, statementList.$index(statementList.length - 1)) && exits) {
+ if ($notnull_bool($ne(stmt, statementList.$index(statementList.length - 1)) && exits)) {
world.warning('unreachable code', statementList.$index(i + 1).get$span());
}
}
@@ -9310,7 +9519,7 @@ MethodGenerator.prototype.visitLabeledStatement = function(node) {
return false;
}
MethodGenerator.prototype.visitExpressionStatement = function(node) {
- if ((node.body instanceof VarExpression) || (node.body instanceof ThisExpression)) {
+ if ($notnull_bool((node.body instanceof VarExpression) || (node.body instanceof ThisExpression))) {
world.warning('variable used as statement', node.span);
}
var value = this.visitVoid(node.body);
@@ -9322,27 +9531,27 @@ MethodGenerator.prototype.visitEmptyStatement = function(node) {
return false;
}
MethodGenerator.prototype._checkNonStatic = function(node) {
- if (this.method.get$isStatic()) {
+ if ($notnull_bool(this.method.get$isStatic())) {
world.warning('not allowed in static method', node.span);
}
}
MethodGenerator.prototype._makeSuperValue = function(node) {
var parentType = this.method.declaringType.get$parent();
this._checkNonStatic(node);
- if (parentType == null) {
+ if ($notnull_bool(parentType == null)) {
world.error('no super class', node.span);
}
return new Value(parentType, 'this', true, true, false);
}
MethodGenerator.prototype._getOutermostMethod = function() {
var result = this;
- while (result.enclosingMethod != null) {
+ while ($notnull_bool(result.enclosingMethod != null)) {
result = result.enclosingMethod;
}
return result;
}
MethodGenerator.prototype._makeThisValue = function(node) {
- if (this.enclosingMethod != null) {
+ if ($notnull_bool(this.enclosingMethod != null)) {
var outermostMethod = this._getOutermostMethod();
outermostMethod._checkNonStatic(node);
outermostMethod.needsThis = true;
@@ -9355,32 +9564,32 @@ MethodGenerator.prototype._makeThisValue = function(node) {
}
MethodGenerator.prototype.visitLambdaExpression = function(node) {
var name = '';
- if (node.func.name != null) {
+ if ($notnull_bool(node.func.name != null)) {
name = world.toJsIdentifier(node.func.name.name);
}
- var meth = this._makeLambdaMethod(name, node.func);
+ var meth = this._makeLambdaMethod($assert_String(name), node.func);
var w = new CodeWriter();
- meth.generator.writeDefinition(w, node);
+ meth.generator.writeDefinition((w && w.is$CodeWriter()), node);
return new Value(meth.get$functionType(), w.get$text(), false, true, false);
}
MethodGenerator.prototype.visitCallExpression = function(node) {
var target;
var position = node.target;
var name = '\$call';
- if ((node.target instanceof DotExpression)) {
+ if ($notnull_bool((node.target instanceof DotExpression))) {
target = node.target.self.visit(this);
name = node.target.get$name().get$name();
position = node.target.get$name();
}
- else if ((node.target instanceof VarExpression)) {
+ else if ($notnull_bool((node.target instanceof VarExpression))) {
name = node.target.get$name().get$name();
var meth = this.method.declaringType.resolveMember(name);
- if ($ne(meth, null)) {
+ if ($notnull_bool($ne(meth, null))) {
target = this._makeThisOrType();
return meth.invoke$4(this, node.target, target, this._makeArgs(node.arguments));
}
- meth = this.method.declaringType.get$library().lookup(name, node.target.span);
- if ($ne(meth, null)) {
+ meth = this.method.declaringType.get$library().lookup($assert_String(name), node.target.span);
+ if ($notnull_bool($ne(meth, null))) {
return meth.invoke$4(this, node.target, null, this._makeArgs(node.arguments));
}
name = '\$call';
@@ -9398,24 +9607,24 @@ MethodGenerator.prototype.visitIndexExpression = function(node) {
}
MethodGenerator.prototype.visitBinaryExpression = function(node) {
var kind = node.op.kind;
- if (kind == 35/*TokenKind.AND*/ || kind == 34/*TokenKind.OR*/) {
+ if ($notnull_bool(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 + '');
- if (x.get$isConst() && y.get$isConst()) {
- var value = (kind == 35/*TokenKind.AND*/) ? x.get$actualValue() && y.get$actualValue() : x.get$actualValue() || y.get$actualValue();
+ if ($notnull_bool(x.get$isConst() && y.get$isConst())) {
+ var value = $notnull_bool((kind == 35/*TokenKind.AND*/)) ? x.get$actualValue() && y.get$actualValue() : x.get$actualValue() || y.get$actualValue();
return EvaluatedValue.EvaluatedValue$factory(x.type, value, ('' + value + ''), node.span);
}
return new Value(null, code, false, true, false);
}
- else if (kind == 50/*TokenKind.EQ_STRICT*/ || kind == 51/*TokenKind.NE_STRICT*/) {
+ else if ($notnull_bool(kind == 50/*TokenKind.EQ_STRICT*/ || kind == 51/*TokenKind.NE_STRICT*/)) {
var x = this.visitValue(node.x);
var y = this.visitValue(node.y);
- if (x.get$isConst() && y.get$isConst()) {
- var value = kind == 50/*TokenKind.EQ_STRICT*/ ? $eq(x.get$actualValue(), y.get$actualValue()) : $ne(x.get$actualValue(), y.get$actualValue());
+ if ($notnull_bool(x.get$isConst() && y.get$isConst())) {
+ var value = $notnull_bool(kind == 50/*TokenKind.EQ_STRICT*/) ? $eq(x.get$actualValue(), y.get$actualValue()) : $ne(x.get$actualValue(), y.get$actualValue());
return EvaluatedValue.EvaluatedValue$factory(world.boolType, value, ("" + value + ""), node.span);
}
- if (x.code == 'null' || y.code == 'null') {
+ if ($notnull_bool(x.code == 'null' || y.code == 'null')) {
var op = node.op.toString().substring(0, 2);
return new Value(null, ('' + x.code + ' ' + op + ' ' + y.code + ''), false, true, false);
}
@@ -9424,14 +9633,14 @@ MethodGenerator.prototype.visitBinaryExpression = function(node) {
}
}
var assignKind = TokenKind.kindFromAssign(node.op.kind);
- if (assignKind == -1) {
+ if ($notnull_bool(assignKind == -1)) {
var x = this.visitValue(node.x);
var y = this.visitValue(node.y);
var name = TokenKind.binaryMethodName(node.op.kind);
- if (node.op.kind == 49/*TokenKind.NE*/) {
+ if ($notnull_bool(node.op.kind == 49/*TokenKind.NE*/)) {
name = '\$ne';
}
- if (name == null) {
+ if ($notnull_bool(name == null)) {
world.internalError(('unimplemented binary op ' + node.op + ''), node.span);
return;
}
@@ -9442,64 +9651,65 @@ MethodGenerator.prototype.visitBinaryExpression = function(node) {
}
}
MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, captureOriginal) {
- if (captureOriginal == null) {
+ if ($notnull_bool(captureOriginal == null)) {
captureOriginal = (function (x) {
return x;
})
;
}
- if ((xn instanceof VarExpression)) {
- return this._visitVarAssign(kind, xn, yn, position, captureOriginal);
+ if ($notnull_bool((xn instanceof VarExpression))) {
+ return this._visitVarAssign(kind, (xn && xn.is$VarExpression()), yn, position, captureOriginal);
}
- else if ((xn instanceof IndexExpression)) {
- return this._visitIndexAssign(kind, xn, yn, position, captureOriginal);
+ else if ($notnull_bool((xn instanceof IndexExpression))) {
+ return this._visitIndexAssign(kind, (xn && xn.is$IndexExpression()), yn, position, captureOriginal);
}
- else if ((xn instanceof DotExpression)) {
- return this._visitDotAssign(kind, xn, yn, position, captureOriginal);
+ else if ($notnull_bool((xn instanceof DotExpression))) {
+ return this._visitDotAssign(kind, (xn && xn.is$DotExpression()), yn, position, captureOriginal);
}
else {
world.error('illegal lhs', position.span);
}
}
MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, captureOriginal) {
+ var $0;
var x = this._scope.lookup(xn.name.name);
var y = this.visitValue(yn);
- if (x == null) {
+ if ($notnull_bool(x == null)) {
var members = this.method.declaringType.resolveMember(xn.name.name);
- if ($ne(members, null)) {
+ if ($notnull_bool($ne(members, null))) {
x = this._makeThisOrType();
}
else {
var member = this.method.declaringType.get$library().lookup(xn.name.name, xn.name.span);
- if (member == null) {
+ if ($notnull_bool(member == null)) {
world.warning(('can not resolve ' + xn.name.name + ''), xn.span);
return this._makeMissingValue(xn.name.name);
}
members = new MemberSet(member);
}
- if (!members.get$treatAsField() || members.get$containsMethods()) {
- if (kind != 0) {
+ if ($notnull_bool(!members.get$treatAsField() || members.get$containsMethods())) {
+ if ($notnull_bool(kind != 0)) {
var right = members.get_$3(this, position, x);
- right = captureOriginal(right);
+ right = captureOriginal((right && right.is$Value()));
y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arguments(null, [y]));
}
return members.set_$4(this, position, x, y);
}
x = members.get_$3(this, position, x);
}
- y = y.convertTo(this, x.type, yn, false);
- if (kind == 0) {
- x = captureOriginal(x);
+ y = y.convertTo(this, (($0 = x.type) && $0.is$lang_Type()), yn, false);
+ if ($notnull_bool(kind == 0)) {
+ x = captureOriginal((x && x.is$Value()));
return new Value(y.type, ('' + x.code + ' = ' + y.code + ''), false, true, false);
}
- else if (x.type.get$isNum() && y.type.get$isNum() && (kind != 46/*TokenKind.TRUNCDIV*/)) {
- x = captureOriginal(x);
+ else if ($notnull_bool(x.type.get$isNum() && y.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 + ''), false, true, false);
}
else {
var right = x;
- right = captureOriginal(right);
+ 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 + ''), false, true, false);
}
@@ -9510,30 +9720,30 @@ MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, c
var y = this.visitValue(yn);
var tmptarget = target;
var tmpindex = index;
- if (kind != 0) {
- tmptarget = this.getTemp(target);
- tmpindex = this.getTemp(index);
- var right = tmptarget.invoke$4(this, '\$index', position, new Arguments(null, [this.assignTemp(tmpindex, index)]));
- right = captureOriginal(right);
+ if ($notnull_bool(kind != 0)) {
+ tmptarget = this.getTemp((target && target.is$Value()));
+ tmpindex = this.getTemp((index && index.is$Value()));
+ var right = tmptarget.invoke$4(this, '\$index', position, new Arguments(null, [this.assignTemp((tmpindex && tmpindex.is$Value()), (index && index.is$Value()))]));
+ right = captureOriginal((right && right.is$Value()));
y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arguments(null, [y]));
}
- var ret = this.assignTemp(tmptarget, target).invoke(this, '\$setindex', position, new Arguments(null, [index, y]), false);
- if ($ne(tmptarget, target)) this.freeTemp(tmptarget);
- if ($ne(tmpindex, index)) this.freeTemp(tmpindex);
+ var ret = this.assignTemp((tmptarget && tmptarget.is$Value()), (target && target.is$Value())).invoke(this, '\$setindex', position, new Arguments(null, [index, y]), false);
+ if ($notnull_bool($ne(tmptarget, target))) this.freeTemp((tmptarget && tmptarget.is$Value()));
+ if ($notnull_bool($ne(tmpindex, index))) this.freeTemp((tmpindex && tmpindex.is$Value()));
return ret;
}
MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, captureOriginal) {
var target = xn.self.visit(this);
var y = this.visitValue(yn);
var tmptarget = target;
- if (kind != 0) {
- tmptarget = this.getTemp(target);
+ if ($notnull_bool(kind != 0)) {
+ tmptarget = this.getTemp((target && target.is$Value()));
var right = tmptarget.get_$3(this, xn.name.name, xn.name);
- right = captureOriginal(right);
+ right = captureOriginal((right && right.is$Value()));
y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arguments(null, [y]));
}
- var ret = this.assignTemp(tmptarget, target).set_(this, xn.name.name, xn.name, y, false);
- if ($ne(tmptarget, target)) this.freeTemp(tmptarget);
+ var ret = this.assignTemp((tmptarget && tmptarget.is$Value()), (target && target.is$Value())).set_(this, xn.name.name, xn.name, (y && y.is$Value()), false);
+ if ($notnull_bool($ne(tmptarget, target))) this.freeTemp((tmptarget && tmptarget.is$Value()));
return ret;
}
MethodGenerator.prototype.visitUnaryExpression = function(node) {
@@ -9542,18 +9752,18 @@ MethodGenerator.prototype.visitUnaryExpression = function(node) {
case 16/*TokenKind.INCR*/:
case 17/*TokenKind.DECR*/:
- if (value.type.get$isNum()) {
+ if ($notnull_bool(value.type.get$isNum())) {
return new Value(value.type, ('' + node.op + '' + value.code + ''), false, true, false);
}
else {
- var kind = (16/*TokenKind.INCR*/ == node.op.kind ? 42/*TokenKind.ADD*/ : 43/*TokenKind.SUB*/);
+ var kind = ($notnull_bool(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);
- return this._visitAssign(kind, node.self, operand, node, to$call$1(null));
+ return this._visitAssign($assert_num(kind), node.self, (operand && operand.is$lang_Expression()), node, to$call$1(null));
}
case 19/*TokenKind.NOT*/:
- if (value.type.get$isBool() && value.get$isConst()) {
+ if ($notnull_bool(value.type.get$isBool() && value.get$isConst())) {
var newVal = !value.get$actualValue();
return EvaluatedValue.EvaluatedValue$factory(value.type, newVal, ('' + newVal + ''), node.span);
}
@@ -9565,12 +9775,12 @@ MethodGenerator.prototype.visitUnaryExpression = function(node) {
case 43/*TokenKind.SUB*/:
case 18/*TokenKind.BIT_NOT*/:
- if (value.type.get$isNum()) {
- if (value.get$isConst()) {
- if (node.op.kind == 42/*TokenKind.ADD*/) {
+ if ($notnull_bool(value.type.get$isNum())) {
+ if ($notnull_bool(value.get$isConst())) {
+ if ($notnull_bool(node.op.kind == 42/*TokenKind.ADD*/)) {
return value;
}
- else if (node.op.kind == 43/*TokenKind.SUB*/) {
+ else if ($notnull_bool(node.op.kind == 43/*TokenKind.SUB*/)) {
var newVal = $negate(value.get$actualValue());
return EvaluatedValue.EvaluatedValue$factory(value.type, newVal, ('' + newVal + ''), node.span);
}
@@ -9583,8 +9793,8 @@ MethodGenerator.prototype.visitUnaryExpression = function(node) {
}
else {
var name;
- if (node.op.kind == 18/*TokenKind.BIT_NOT*/) name = '\$bit_not';
- else if (node.op.kind == 43/*TokenKind.SUB*/) name = '\$negate';
+ if ($notnull_bool(node.op.kind == 18/*TokenKind.BIT_NOT*/)) name = '\$bit_not';
+ else if ($notnull_bool(node.op.kind == 43/*TokenKind.SUB*/)) name = '\$negate';
else world.internalError(('unimplemented: unary ' + node.op + ' on var'), node.span);
return new Value(world.varType, ('' + name + '(' + value.code + ')'), false, true, false);
}
@@ -9598,65 +9808,66 @@ MethodGenerator.prototype.visitUnaryExpression = function(node) {
MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) {
var $this = this; // closure support
var value = this.visitValue(node.body);
- if (value.type.get$isNum()) {
+ if ($notnull_bool(value.type.get$isNum())) {
return new Value(value.type, ('' + value.code + '' + node.op + ''), false, true, false);
}
- var kind = (16/*TokenKind.INCR*/ == node.op.kind) ? 42/*TokenKind.ADD*/ : 43/*TokenKind.SUB*/;
+ var kind = $notnull_bool((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);
var tmpleft = null, left = null;
- var ret = this._visitAssign(kind, node.body, operand, node, (function (l) {
- if (isVoid) {
+ var ret = this._visitAssign($assert_num(kind), node.body, (operand && operand.is$lang_Expression()), node, (function (l) {
+ if ($notnull_bool(isVoid)) {
return l;
}
else {
left = l;
- tmpleft = $this.forceTemp(l);
- return $this.assignTemp(tmpleft, left);
+ tmpleft = $this.forceTemp((l && l.is$Value()));
+ return $this.assignTemp((tmpleft && tmpleft.is$Value()), (left && left.is$Value()));
}
})
);
- if ($ne(tmpleft, null)) {
+ if ($notnull_bool($ne(tmpleft, null))) {
ret = new Value(ret.type, ("(" + ret.code + ", " + tmpleft.code + ")"), false, true, false);
}
- if ($ne(tmpleft, left)) {
- this.freeTemp(tmpleft);
+ if ($notnull_bool($ne(tmpleft, left))) {
+ this.freeTemp((tmpleft && tmpleft.is$Value()));
}
return ret;
}
MethodGenerator.prototype.visitNewExpression = function(node) {
+ var $0;
var typeRef = node.type;
var constructorName = '';
- if (node.name != null) {
+ if ($notnull_bool(node.name != null)) {
constructorName = node.name.name;
}
- if ($eq(constructorName, '') && !(typeRef instanceof GenericTypeReference) && typeRef.names != null) {
+ if ($notnull_bool($eq(constructorName, '') && !(typeRef instanceof GenericTypeReference) && typeRef.names != null)) {
var names = ListFactory.ListFactory$from$factory(typeRef.names);
constructorName = names.removeLast().get$name();
- if (names.length == 0) names = null;
+ if ($notnull_bool(names.length == 0)) names = null;
typeRef = new NameTypeReference(typeRef.isFinal, typeRef.get$name(), names, typeRef.get$span());
}
var type = this.method.resolveType(typeRef, true);
- if (type.get$isTop()) {
- type = type.get$library().findTypeByName(constructorName);
+ if ($notnull_bool(type.get$isTop())) {
+ type = type.get$library().findTypeByName($assert_String(constructorName));
constructorName = '';
}
var m = type.getConstructor(constructorName);
- if (m == null) {
+ if ($notnull_bool(m == null)) {
var name = type.get$jsname();
- if (type.get$isVar()) {
+ if ($notnull_bool(type.get$isVar())) {
name = typeRef.get$name().get$name();
}
world.error(('no matching constructor for ' + name + ''), node.span);
- return this._makeMissingValue(name);
+ return this._makeMissingValue($assert_String(name));
}
- if (node.isConst) {
- if (!m.get$isConst()) {
+ if ($notnull_bool(node.isConst)) {
+ if ($notnull_bool(!m.get$isConst())) {
world.error('can\'t use const on a non-const constructor', node.span);
}
var $list = node.arguments;
for (var $i = 0;$i < $list.length; $i++) {
var arg = $list.$index($i);
- if (!this.visitValue(arg.get$value()).get$isConst()) {
+ 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());
}
}
@@ -9669,10 +9880,10 @@ MethodGenerator.prototype.visitListExpression = function(node) {
var $list = node.values;
for (var $i = 0;$i < $list.length; $i++) {
var item = $list.$index($i);
- var arg = this.visitValue(item);
+ var arg = this.visitValue((item && item.is$lang_Expression()));
argValues.add(arg);
- if (node.isConst) {
- if (!arg.get$isConst()) {
+ 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(arg.code);
}
@@ -9685,29 +9896,30 @@ MethodGenerator.prototype.visitListExpression = function(node) {
}
}
world.get$coreimpl().types.$index('ListFactory').markUsed();
- var code = ('[' + Strings.join(argsCode, ", ") + ']');
+ var code = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ") + ']');
var value = new Value(world.listType, code, false, true, false);
- if (node.isConst) {
+ if ($notnull_bool(node.isConst)) {
var immutableList = world.get$coreimpl().types.$index('ImmutableList');
var immutableListCtor = immutableList.getConstructor('from');
var result = immutableListCtor.invoke$4(this, node, null, new Arguments(null, [value]));
- value = world.gen.globalForConst(ConstListValue.ConstListValue$factory(immutableList, argValues, ('const ' + code + ''), result.code, node.span), argValues);
+ value = world.gen.globalForConst(ConstListValue.ConstListValue$factory((immutableList && immutableList.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), ('const ' + code + ''), result.code, node.span), (argValues && argValues.is$List$Value()));
}
return value;
}
MethodGenerator.prototype.visitMapExpression = function(node) {
+ var $0;
var mapImplType = world.gen.useMapFactory();
var argValues = [];
var argsCode = [];
for (var i = 0;
- i < node.items.length; i += 2) {
- var key = this.visitTypedValue(node.items.$index(i), world.stringType);
+ $notnull_bool(i < node.items.length); i += 2) {
+ var key = this.visitTypedValue((($0 = node.items.$index(i)) && $0.is$lang_Expression()), world.stringType);
var valueItem = node.items.$index(i + 1);
- var value = this.visitValue(valueItem);
+ var value = this.visitValue((valueItem && valueItem.is$lang_Expression()));
argValues.add(key);
argValues.add(value);
- if (node.isConst) {
- if (!key.get$isConst() || !value.get$isConst()) {
+ if ($notnull_bool(node.isConst)) {
+ if ($notnull_bool(!key.get$isConst() || !value.get$isConst())) {
world.error('const map can only contain const values', valueItem.get$span());
argsCode.add(key.code);
argsCode.add(value.code);
@@ -9722,33 +9934,34 @@ MethodGenerator.prototype.visitMapExpression = function(node) {
argsCode.add(value.code);
}
}
- var argList = ('[' + Strings.join(argsCode, ", ") + ']');
+ var argList = ('[' + Strings.join((argsCode && argsCode.is$List$String()), ", ") + ']');
var code = ('\$map(' + argList + ')');
- if (node.isConst) {
+ if ($notnull_bool(node.isConst)) {
var immutableMap = world.get$coreimpl().types.$index('ImmutableMap');
var immutableMapCtor = immutableMap.getConstructor('');
var argsValue = new Value(world.listType, argList, false, true, false);
var result = immutableMapCtor.invoke$4(this, node, null, new Arguments(null, [argsValue]));
- var value = ConstMapValue.ConstMapValue$factory(immutableMap, argValues, code, result.code, node.span);
- return world.gen.globalForConst(value, argValues);
+ var value = ConstMapValue.ConstMapValue$factory((immutableMap && immutableMap.is$lang_Type()), (argValues && argValues.is$List$EvaluatedValue()), code, result.code, node.span);
+ return world.gen.globalForConst(value, (argValues && argValues.is$List$Value()));
}
return new Value(mapImplType, code, false, true, false);
}
MethodGenerator.prototype.visitConditionalExpression = function(node) {
+ var $0;
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(trueBranch.type, falseBranch.type), code, false, true, false);
+ return new Value(lang_Type.union((($0 = trueBranch.type) && $0.is$lang_Type()), (($0 = falseBranch.type) && $0.is$lang_Type())), code, false, true, false);
}
MethodGenerator.prototype.visitIsExpression = function(node) {
var value = this.visitValue(node.x);
var type = this.method.resolveType(node.type, false);
- return value.instanceOf(this, type, node.span, node.isTrue, false);
+ return value.instanceOf(this, (type && type.is$lang_Type()), node.span, node.isTrue, false);
}
MethodGenerator.prototype.visitParenExpression = function(node) {
var body = this.visitValue(node.body);
- if (body.get$isConst()) {
+ if ($notnull_bool(body.get$isConst())) {
return EvaluatedValue.EvaluatedValue$factory(body.type, body.get$actualValue(), ('(' + body.canonicalCode + ')'), node.span);
}
return new Value(body.type, ('(' + body.code + ')'), false, true, false);
@@ -9759,13 +9972,13 @@ MethodGenerator.prototype.visitDotExpression = function(node) {
}
MethodGenerator.prototype.visitVarExpression = function(node) {
var ret = this._scope.lookup(node.name.name);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
ret = this.method.declaringType.resolveMember(node.name.name);
- if ($ne(ret, null)) {
+ if ($notnull_bool($ne(ret, null))) {
return ret.get_$3(this, node, this._makeThisOrType());
}
ret = this.method.declaringType.get$library().lookup(node.name.name, node.span);
- if ($ne(ret, null)) {
+ if ($notnull_bool($ne(ret, null))) {
return ret.get_$3(this, node);
}
world.warning(('can not resolve ' + node.name.name + ''), node.span);
@@ -9776,7 +9989,7 @@ MethodGenerator.prototype._makeMissingValue = function(name) {
}
MethodGenerator.prototype._makeThisOrType = function() {
var outermost = this._getOutermostMethod();
- if (outermost.method.get$isStatic()) {
+ if ($notnull_bool(outermost.method.get$isStatic())) {
return this._makeTypeValue(outermost.method.declaringType);
}
else {
@@ -9798,42 +10011,43 @@ MethodGenerator.prototype.visitNullExpression = function(node) {
MethodGenerator.prototype.visitLiteralExpression = function(node) {
var $0;
var type = node.type.type;
- if (!!(($0 = node.value) && $0.is$List)) {
+ $assert($ne(type, null), "type != null", "gen.dart", 2018, 12);
+ if ($notnull_bool(!!(($0 = node.value) && $0.is$List))) {
var items = [];
var $list = node.value;
for (var $i = node.value.iterator(); $i.hasNext(); ) {
var item = $i.next();
- var val = this.visitValue(item);
+ var val = this.visitValue((item && item.is$lang_Expression()));
val.invoke$4(this, 'toString', item, Arguments.get$EMPTY());
var code = val.code;
- if ((item instanceof BinaryExpression) || (item instanceof ConditionalExpression)) {
+ if ($notnull_bool((item instanceof BinaryExpression) || (item instanceof ConditionalExpression))) {
code = ('(' + code + ')');
}
items.add(code);
}
- return new Value(type, ('(' + Strings.join(items, " + ") + ')'), false, true, false);
+ return new Value(type, ('(' + Strings.join((items && items.is$List$String()), " + ") + ')'), false, true, false);
}
var text = node.text;
- if (type.get$isString()) {
- if (text.startsWith('@')) {
- text = MethodGenerator._escapeString(parseStringLiteral(text));
+ if ($notnull_bool(type.get$isString())) {
+ if ($notnull_bool(text.startsWith('@'))) {
+ text = MethodGenerator._escapeString(parseStringLiteral($assert_String(text)));
text = ('"' + text + '"');
}
- else if (isMultilineString(text)) {
- text = parseStringLiteral(text);
+ else if ($notnull_bool(isMultilineString($assert_String(text)))) {
+ text = parseStringLiteral($assert_String(text));
text = text.replaceAll('\n', '\\n');
text = text.replaceAll('"', '\\"');
text = ('"' + text + '"');
}
- if (text !== node.text) {
+ if ($notnull_bool(text !== node.text)) {
node.value = text;
- node.text = text;
+ node.text = $assert_String(text);
}
}
return EvaluatedValue.EvaluatedValue$factory(type, node.value, node.text, null);
}
MethodGenerator.prototype.visitPostfixExpression$1 = function($0) {
- return this.visitPostfixExpression($0, false);
+ return this.visitPostfixExpression(($0 && $0.is$PostfixExpression()), false);
}
;
// ********** Code for Arguments **************
@@ -9842,16 +10056,17 @@ function Arguments(nodes, values) {
this.values = values;
// Initializers done
}
+Arguments.prototype.is$Arguments = function(){return this;};
Arguments.Arguments$bare$factory = function(arity) {
var values0 = [];
for (var i = 0;
- i < arity; i++) {
+ $notnull_bool(i < arity); i++) {
values0.add(new Value(world.varType, ('\$' + i + ''), false, false, false));
}
return new Arguments(null, values0);
}
Arguments.get$EMPTY = function() {
- if (Arguments._empty == null) {
+ if ($notnull_bool(Arguments._empty == null)) {
Arguments._empty = new Arguments(null, []);
}
return Arguments._empty;
@@ -9873,8 +10088,8 @@ Arguments.prototype.getName = function(i) {
}
Arguments.prototype.getIndexOfName = function(name) {
for (var i = this.get$bareCount();
- i < this.get$length(); i++) {
- if (this.getName(i) == name) {
+ $notnull_bool(i < this.get$length()); i++) {
+ if ($notnull_bool(this.getName(i) == name)) {
return i;
}
}
@@ -9882,15 +10097,15 @@ Arguments.prototype.getIndexOfName = function(name) {
}
Arguments.prototype.getValue = function(name) {
var i = this.getIndexOfName(name);
- return i >= 0 ? this.values.$index(i) : null;
+ return $notnull_bool(i >= 0) ? this.values.$index(i) : null;
}
Arguments.prototype.get$bareCount = function() {
- if (this._bareCount == null) {
+ if ($notnull_bool(this._bareCount == null)) {
this._bareCount = this.get$length();
- if (this.nodes != null) {
+ if ($notnull_bool(this.nodes != null)) {
for (var i = 0;
- i < this.nodes.length; i++) {
- if (this.nodes.$index(i).label != null) {
+ $notnull_bool(i < this.nodes.length); i++) {
+ if ($notnull_bool(this.nodes.$index(i).label != null)) {
this._bareCount = i;
break;
}
@@ -9902,21 +10117,21 @@ Arguments.prototype.get$bareCount = function() {
Arguments.prototype.getCode = function() {
var argsCode = [];
for (var i = 0;
- i < this.get$length(); i++) {
+ $notnull_bool(i < this.get$length()); i++) {
argsCode.add(this.values.$index(i).code);
}
- Arguments.removeTrailingNulls(argsCode);
- return Strings.join(argsCode, ", ");
+ Arguments.removeTrailingNulls((argsCode && argsCode.is$List$Value()));
+ return Strings.join((argsCode && argsCode.is$List$String()), ", ");
}
Arguments.removeTrailingNulls = function(argsCode) {
- while (argsCode.length > 0 && $eq(argsCode.last(), 'null')) {
+ while ($notnull_bool(argsCode.length > 0 && $eq(argsCode.last(), 'null'))) {
argsCode.removeLast();
}
}
Arguments.prototype.getNames = function() {
var names = [];
for (var i = this.get$bareCount();
- i < this.get$length(); i++) {
+ $notnull_bool(i < this.get$length()); i++) {
names.add(this.getName(i));
}
return names;
@@ -9924,13 +10139,13 @@ Arguments.prototype.getNames = function() {
Arguments.prototype.toCallStubArgs = function() {
var result = [];
for (var i = 0;
- i < this.get$bareCount(); i++) {
+ $notnull_bool(i < this.get$bareCount()); i++) {
result.add(new Value(world.varType, ('\$' + i + ''), false, false, false));
}
for (var i = this.get$bareCount();
- i < this.get$length(); i++) {
+ $notnull_bool(i < this.get$length()); i++) {
var name = this.getName(i);
- if (name == null) name = ('\$' + i + '');
+ if ($notnull_bool(name == null)) name = ('\$' + i + '');
result.add(new Value(world.varType, name, false, false, false));
}
return new Arguments(this.nodes, result);
@@ -9965,7 +10180,7 @@ Library.prototype.get$isCoreImpl = function() {
return $eq(this, world.get$coreimpl());
}
Library.prototype.get$jsname = function() {
- if (this._jsname == null) {
+ if ($notnull_bool(this._jsname == null)) {
this._jsname = this.name.replaceAll('.', '_').replaceAll(':', '_').replaceAll(' ', '_');
}
return this._jsname;
@@ -9974,10 +10189,10 @@ Library.prototype.get$span = function() {
return new SourceSpan(this.baseSource, 0, 0);
}
Library.prototype.makeFullPath = function(filename) {
- if (filename.startsWith('dart:')) return filename;
- if (filename.startsWith('/')) return filename;
- if (filename.startsWith('file:///')) return filename;
- if (filename.startsWith('http://')) return filename;
+ if ($notnull_bool(filename.startsWith('dart:'))) return filename;
+ if ($notnull_bool(filename.startsWith('/'))) return filename;
+ if ($notnull_bool(filename.startsWith('file:///'))) return filename;
+ if ($notnull_bool(filename.startsWith('http://'))) return filename;
return joinPaths(this.sourceDir, filename);
}
Library.prototype.addImport = function(fullname, prefix) {
@@ -9987,7 +10202,7 @@ Library.prototype.addNative = function(fullname) {
this.natives.add(world.reader.readFile(fullname));
}
Library.prototype._findMembers = function(name0) {
- if (name0.startsWith('_')) {
+ if ($notnull_bool(name0.startsWith('_'))) {
return this._privateMembers.$index(name0);
}
else {
@@ -9995,19 +10210,20 @@ Library.prototype._findMembers = function(name0) {
}
}
Library.prototype._addMember = function(member) {
- if (member.get$isPrivate()) {
- if (member.get$isStatic()) {
- if (member.declaringType.get$isTop()) {
+ var $0;
+ if ($notnull_bool(member.get$isPrivate())) {
+ if ($notnull_bool(member.get$isStatic())) {
+ if ($notnull_bool(member.declaringType.get$isTop())) {
world._addTopName(member);
}
return;
}
var mset = this._privateMembers.$index(member.name);
- if (mset == null) {
+ if ($notnull_bool(mset == null)) {
var $list = world.libraries.getValues();
for (var $i = world.libraries.getValues().iterator(); $i.hasNext(); ) {
var lib = $i.next();
- if (lib._privateMembers.containsKey(member.name)) {
+ if ($notnull_bool(lib._privateMembers.containsKey(member.name))) {
member.set$jsname(('_' + this.get$jsname() + '' + member.name + ''));
break;
}
@@ -10032,31 +10248,31 @@ Library.prototype.getOrAddFunctionType = function(name0, func, inType) {
return type;
}
Library.prototype.addType = function(name0, definition, isClass) {
- if (this.types.containsKey(name0)) {
+ if ($notnull_bool(this.types.containsKey(name0))) {
var existingType = this.types.$index(name0);
- if (this.get$isCore() && existingType.get$definition() == null) {
- existingType.setDefinition(definition);
+ if ($notnull_bool(this.get$isCore() && existingType.get$definition() == null)) {
+ existingType.setDefinition((definition && definition.is$Definition()));
}
else {
world.warning(('duplicate definition of ' + name0 + ''), definition.span);
}
}
else {
- this.types.$setindex(name0, new DefinedType(name0, this, definition, isClass));
+ this.types.$setindex(name0, new DefinedType(name0, this, (definition && definition.is$Definition()), isClass));
}
return this.types.$index(name0);
}
Library.prototype.findType = function(type) {
var result = this.findTypeByName(type.name.name);
- if (result == null) return null;
- if (type.names != null) {
- if (type.names.length > 1) {
+ if ($notnull_bool(result == null)) return null;
+ if ($notnull_bool(type.names != null)) {
+ if ($notnull_bool(type.names.length > 1)) {
return null;
}
- if (!result.get$isTop()) {
+ if ($notnull_bool(!result.get$isTop())) {
return null;
}
- return result.get$library().findTypeByName(type.names.$index(0).get$name());
+ return result.get$library().findTypeByName($assert_String(type.names.$index(0).get$name()));
}
return result;
}
@@ -10066,14 +10282,14 @@ Library.prototype.findTypeByName = function(name0) {
for (var $i = 0;$i < $list.length; $i++) {
var imported = $list.$index($i);
var newRet = null;
- if (imported.prefix == null) {
+ if ($notnull_bool(imported.prefix == null)) {
newRet = imported.get$library().types.$index(name0);
}
- else if (imported.prefix == name0) {
+ else if ($notnull_bool(imported.prefix == name0)) {
newRet = imported.get$library().topType;
}
- if ($ne(newRet, null)) {
- if ($ne(ret, null) && $ne(ret, newRet)) {
+ if ($notnull_bool($ne(newRet, null))) {
+ if ($notnull_bool($ne(ret, null) && $ne(ret, newRet))) {
world.error(('conflicting types for "' + name0 + '"'), ret.get$span());
world.error(('conflicting types for "' + name0 + '"'), newRet.get$span());
}
@@ -10087,12 +10303,12 @@ Library.prototype.findTypeByName = function(name0) {
Library.prototype.lookup = function(name0, span0) {
var retType = this.findTypeByName(name0);
var ret = null;
- if ($ne(retType, null)) {
+ if ($notnull_bool($ne(retType, null))) {
ret = retType.get$typeMember();
}
var newRet = this.topType.getMember(name0);
- if ($ne(newRet, null)) {
- if ($ne(ret, null) && $ne(ret, newRet)) {
+ if ($notnull_bool($ne(newRet, null))) {
+ if ($notnull_bool($ne(ret, null) && $ne(ret, newRet))) {
world.error(('conflicting members for "' + name0 + '"'), span0);
world.error(('conflicting members for "' + name0 + '"'), ret.get$span());
world.error(('conflicting members for "' + name0 + '"'), newRet.get$span());
@@ -10104,10 +10320,10 @@ Library.prototype.lookup = function(name0, span0) {
var $list = this.imports;
for (var $i = 0;$i < $list.length; $i++) {
var imported = $list.$index($i);
- if (imported.prefix == null) {
+ if ($notnull_bool(imported.prefix == null)) {
newRet = imported.get$library().topType.getMember(name0);
- if ($ne(newRet, null)) {
- if ($ne(ret, null) && $ne(ret, newRet)) {
+ if ($notnull_bool($ne(newRet, null))) {
+ if ($notnull_bool($ne(ret, null) && $ne(ret, newRet))) {
world.error(('conflicting members for "' + name0 + '"'), span0);
world.error(('conflicting members for "' + name0 + '"'), ret.get$span());
world.error(('conflicting members for "' + name0 + '"'), newRet.get$span());
@@ -10121,14 +10337,15 @@ Library.prototype.lookup = function(name0, span0) {
return ret;
}
Library.prototype.resolve = function() {
- if (this.name == null) {
+ var $0;
+ if ($notnull_bool(this.name == null)) {
this.name = this.baseSource.filename;
var index = this.name.lastIndexOf('/', this.name.length);
- if (index >= 0) {
+ if ($notnull_bool(index >= 0)) {
this.name = this.name.substring(index + 1);
}
index = this.name.indexOf('.', 0);
- if (index > 0) {
+ if ($notnull_bool(index > 0)) {
this.name = this.name.substring(0, index);
}
}
@@ -10155,6 +10372,7 @@ LibraryVisitor.prototype.addSourceFromName = function(name) {
this.sources.add(source);
}
LibraryVisitor.prototype.addSource = function(source) {
+ var $0;
this.library.sources.add(source);
var parser = new lang_Parser(source, options.dietParse, 0);
var unit = parser.compilationUnit();
@@ -10166,7 +10384,7 @@ LibraryVisitor.prototype.addSource = function(source) {
this.sources = [];
for (var $i = newSources.iterator(); $i.hasNext(); ) {
var source0 = $i.next();
- this.addSource(source0);
+ this.addSource((source0 && source0.is$SourceFile()));
}
}
LibraryVisitor.prototype.visitDirectiveDefinition = function(node) {
@@ -10175,9 +10393,9 @@ LibraryVisitor.prototype.visitDirectiveDefinition = function(node) {
case "library":
name = this.getSingleStringArg(node);
- if (this.library.name == null) {
- this.library.name = name;
- if ($eq(name, 'node') || $eq(name, 'dom')) {
+ if ($notnull_bool(this.library.name == null)) {
+ this.library.name = $assert_String(name);
+ if ($notnull_bool($eq(name, 'node') || $eq(name, 'dom'))) {
this.library.topType.isNativeType = true;
}
}
@@ -10190,26 +10408,26 @@ LibraryVisitor.prototype.visitDirectiveDefinition = function(node) {
name = this.getFirstStringArg(node);
var prefix = this.tryGetNamedStringArg(node, 'prefix');
- if (node.arguments.length > 2 || node.arguments.length == 2 && prefix == null) {
+ if ($notnull_bool(node.arguments.length > 2 || node.arguments.length == 2 && prefix == null)) {
world.error('expected at most one "name" argument and one optional "prefix"' + (' but found ' + node.arguments.length + ''), node.span);
}
- else if ($ne(prefix, null) && prefix.indexOf('.', 0) >= 0) {
+ else if ($notnull_bool($ne(prefix, null) && prefix.indexOf('.', 0) >= 0)) {
world.error('library prefix canot contain "."', node.span);
}
- if ($eq(prefix, '')) prefix = null;
- this.library.addImport(this.library.makeFullPath(name), prefix);
+ if ($notnull_bool($eq(prefix, ''))) prefix = null;
+ this.library.addImport(this.library.makeFullPath($assert_String(name)), $assert_String(prefix));
break;
case "source":
name = this.getSingleStringArg(node);
- this.addSourceFromName(name);
+ this.addSourceFromName($assert_String(name));
break;
case "native":
name = this.getSingleStringArg(node);
- this.library.addNative(this.library.makeFullPath(name));
+ this.library.addNative(this.library.makeFullPath($assert_String(name)));
break;
case "resource":
@@ -10224,43 +10442,44 @@ LibraryVisitor.prototype.visitDirectiveDefinition = function(node) {
}
}
LibraryVisitor.prototype.getSingleStringArg = function(node) {
- if (node.arguments.length != 1) {
+ if ($notnull_bool(node.arguments.length != 1)) {
world.error(('expected exactly one argument but found ' + node.arguments.length + ''), node.span);
}
return this.getFirstStringArg(node);
}
LibraryVisitor.prototype.getFirstStringArg = function(node) {
- if (node.arguments.length < 1) {
+ if ($notnull_bool(node.arguments.length < 1)) {
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(arg.label != null)) {
world.error('label not allowed for directive', node.span);
}
- return this._parseStringArgument(arg);
+ return this._parseStringArgument((arg && arg.is$ArgumentNode()));
}
LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) {
+ var $0;
var args = node.arguments.filter((function (a) {
return a.label != null && a.label.name == argName;
})
);
- if (args.length == 0) {
+ if ($notnull_bool(args.length == 0)) {
return null;
}
- if (args.length > 1) {
+ if ($notnull_bool(args.length > 1)) {
world.error(('expected at most one "' + argName + '" argument but found ') + node.arguments.length, node.span);
}
for (var $i = args.iterator(); $i.hasNext(); ) {
var arg = $i.next();
- return this._parseStringArgument(arg);
+ return this._parseStringArgument((arg && arg.is$ArgumentNode()));
}
}
LibraryVisitor.prototype._parseStringArgument = function(arg) {
var expr = arg.value;
- if (!(expr instanceof LiteralExpression) || !expr.type.type.get$isString()) {
+ if ($notnull_bool(!(expr instanceof LiteralExpression) || !expr.type.type.get$isString())) {
world.error('expected string', expr.get$span());
}
- return parseStringLiteral(expr.get$value());
+ return parseStringLiteral($assert_String(expr.get$value()));
}
LibraryVisitor.prototype.visitTypeDefinition = function(node) {
var oldType = this.currentType;
@@ -10270,7 +10489,7 @@ LibraryVisitor.prototype.visitTypeDefinition = function(node) {
var member = $list.$index($i);
member.visit(this);
}
- this.currentType = oldType;
+ this.currentType = (oldType && oldType.is$lang_Type());
}
LibraryVisitor.prototype.visitVariableDefinition = function(node) {
this.currentType.addField(node);
@@ -10298,11 +10517,12 @@ lang_Parameter.prototype.resolve = function(inType) {
this.type = inType.resolveType(this.definition.type, false);
}
lang_Parameter.prototype.genValue = function(method, context) {
- if (this.definition.value == null || this.value != null) return;
- if (context == null) {
+ var $0;
+ if ($notnull_bool(this.definition.value == null || this.value != null)) return;
+ if ($notnull_bool(context == null)) {
context = new MethodGenerator(method, null);
}
- this.value = this.definition.value.visit(context);
+ this.value = (($0 = this.definition.value.visit(context)) && $0.is$Value());
this.value = this.value.convertTo(context, this.type, this.definition.value, false);
}
lang_Parameter.prototype.copyWithNewType = function(newType) {
@@ -10321,9 +10541,11 @@ function Member(name, declaringType) {
this.isGenerated = false;
// Initializers done
}
+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$jsname = function() {
- return this._jsname == null ? this.name : this._jsname;
+ return $notnull_bool(this._jsname == null) ? this.name : this._jsname;
}
Member.prototype.set$jsname = function(name0) {
return this._jsname = name0;
@@ -10381,31 +10603,38 @@ Member.prototype.invoke = function(context, node, target, args, isDynamic) {
return newTarget.invoke(context, '\$call', node, args, isDynamic);
}
Member.prototype.override = function(other) {
- if (this.get$isStatic()) {
+ if ($notnull_bool(this.get$isStatic())) {
world.error('static members can not hide parent members', this.get$span(), other.get$span());
return false;
}
- else if (other.get$isStatic()) {
+ else if ($notnull_bool(other.get$isStatic())) {
world.error('can not override static member', this.get$span(), other.get$span());
return false;
}
return true;
}
Member.prototype.get$generatedFactoryName = function() {
+ $assert(this.get$isFactory(), "this.isFactory", "member.dart", 132, 12);
var prefix = ('' + this.declaringType.get$jsname() + '.' + this.get$constructorName() + '\$');
- if (this.name == '') {
+ if ($notnull_bool(this.name == '')) {
return ('' + prefix + 'factory');
}
else {
return ('' + prefix + '' + this.name + '\$factory');
}
}
-Member.prototype.get_$3 = Member.prototype.get_;
+Member.prototype.get_$3 = function($0, $1, $2) {
+ return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()));
+}
+;
Member.prototype.invoke$4 = function($0, $1, $2, $3) {
- return this.invoke($0, $1, $2, $3, false);
+ return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
+}
+;
+Member.prototype.set_$4 = function($0, $1, $2, $3) {
+ return this.set_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()));
}
;
-Member.prototype.set_$4 = Member.prototype.set_;
// ********** Code for TypeMember **************
function TypeMember(type0) {
this.type = type0;
@@ -10435,6 +10664,7 @@ TypeMember.prototype.resolve = function(inType) {
}
TypeMember.prototype.get_ = function(context, node, target, isDynamic) {
+ $assert(target == null || target.type.get$isTop(), "target == null || target.type.isTop", "member.dart", 170, 12);
return new Value(this.type, this.type.get$jsname(), false, false, true);
}
TypeMember.prototype.set_ = function(context, node, target, value, isDynamic) {
@@ -10444,15 +10674,15 @@ TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) {
world.error('can not invoke type', this.type.definition.span);
}
TypeMember.prototype.get_$3 = function($0, $1, $2) {
- return this.get_($0, $1, $2, false);
+ return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), false);
}
;
TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) {
- return this.invoke($0, $1, $2, $3, false);
+ return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
}
;
TypeMember.prototype.set_$4 = function($0, $1, $2, $3) {
- return this.set_($0, $1, $2, $3, false);
+ return this.set_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false);
}
;
// ********** Code for FieldMember **************
@@ -10466,6 +10696,7 @@ function FieldMember(name0, declaringType0, definition, value) {
// Initializers done
}
$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$isStatic = function() { return this.isStatic; };
@@ -10473,8 +10704,8 @@ FieldMember.prototype.set$isStatic = function(value) { return this.isStatic = va
FieldMember.prototype.get$isNative = function() { return this.isNative; };
FieldMember.prototype.set$isNative = function(value) { return this.isNative = value; };
FieldMember.prototype.override = function(other) {
- if (!Member.prototype.override.call(this, other)) return false;
- if (other.get$isProperty()) {
+ if ($notnull_bool(!Member.prototype.override.call(this, other))) return false;
+ if ($notnull_bool(other.get$isProperty())) {
return true;
}
else {
@@ -10495,7 +10726,7 @@ FieldMember.prototype.providePropertySyntax = function() {
return this._providePropertySyntax = true;
}
FieldMember.prototype.get$span = function() {
- return this.definition == null ? null : this.definition.span;
+ return $notnull_bool(this.definition == null) ? null : this.definition.span;
}
FieldMember.prototype.get$returnType = function() {
return this.type;
@@ -10512,18 +10743,18 @@ FieldMember.prototype.get$isField = function() {
FieldMember.prototype.resolve = function(inType) {
this.isStatic = this.declaringType.get$isTop();
this.isFinal = false;
- if (this.definition.modifiers != null) {
+ if ($notnull_bool(this.definition.modifiers != null)) {
var $list = this.definition.modifiers;
for (var $i = 0;$i < $list.length; $i++) {
var mod = $list.$index($i);
- if (mod.kind == 85/*TokenKind.STATIC*/) {
- if (this.isStatic) {
+ if ($notnull_bool(mod.kind == 86/*TokenKind.STATIC*/)) {
+ if ($notnull_bool(this.isStatic)) {
world.error('duplicate static modifier', mod.get$span());
}
this.isStatic = true;
}
- else if (mod.kind == 96/*TokenKind.FINAL*/) {
- if (this.isFinal) {
+ else if ($notnull_bool(mod.kind == 97/*TokenKind.FINAL*/)) {
+ if ($notnull_bool(this.isFinal)) {
world.error('duplicate final modifier', mod.get$span());
}
this.isFinal = true;
@@ -10534,15 +10765,16 @@ FieldMember.prototype.resolve = function(inType) {
}
}
this.type = inType.resolveType(this.definition.type, false);
- if (this.isStatic && this.type.get$hasTypeParams()) {
+ if ($notnull_bool(this.isStatic && this.type.get$hasTypeParams())) {
world.error('using type parameter in static context', this.definition.type.span);
}
this.get$library()._addMember(this);
}
FieldMember.prototype.computeValue = function() {
- if (this.value == null) return null;
- if (this._computedValue == null) {
- if (this._computing) {
+ var $0;
+ if ($notnull_bool(this.value == null)) return null;
+ if ($notnull_bool(this._computedValue == null)) {
+ if ($notnull_bool(this._computing)) {
world.error('circular reference', this.value.span);
return null;
}
@@ -10550,16 +10782,16 @@ FieldMember.prototype.computeValue = function() {
var finalMethod = new MethodMember('final_context', this.declaringType, null);
finalMethod.isStatic = true;
var finalGen = new MethodGenerator(finalMethod, null);
- this._computedValue = this.value.visit(finalGen);
- if (!this._computedValue.get$isConst()) {
- if (this.isStatic) {
+ this._computedValue = (($0 = this.value.visit(finalGen)) && $0.is$Value());
+ if ($notnull_bool(!this._computedValue.get$isConst())) {
+ if ($notnull_bool(this.isStatic)) {
world.error('non constant static field must be initialized in functions', this.value.span);
}
else {
world.error('non constant field must be initialized in constructor', this.value.span);
}
}
- if (this.isStatic) {
+ if ($notnull_bool(this.isStatic)) {
this._computedValue = world.gen.globalForStaticField(this, this._computedValue, [this._computedValue]);
}
this._computing = false;
@@ -10567,27 +10799,27 @@ FieldMember.prototype.computeValue = function() {
return this._computedValue;
}
FieldMember.prototype.get_ = function(context, node, target, isDynamic) {
- if (!isDynamic) {
+ if ($notnull_bool(!isDynamic)) {
this.declaringType.markUsed();
}
- if (this.isStatic) {
+ if ($notnull_bool(this.isStatic)) {
var cv = this.computeValue();
- if (this.isFinal) {
+ if ($notnull_bool(this.isFinal)) {
return cv;
}
- if (this.declaringType.get$isTop()) {
+ if ($notnull_bool(this.declaringType.get$isTop())) {
return new Value(this.type, ('' + this.get$jsname() + ''), false, true, false);
}
else {
return new Value(this.type, ('' + this.declaringType.get$jsname() + '.' + this.get$jsname() + ''), false, true, false);
}
}
- else if (target.get$isConst() && this.isFinal) {
- var constTarget = (target instanceof GlobalValue) ? target.exp : target;
- if ((constTarget instanceof ConstObjectValue)) {
+ else if ($notnull_bool(target.get$isConst() && this.isFinal)) {
+ var constTarget = $notnull_bool((target instanceof GlobalValue)) ? target.exp : target;
+ if ($notnull_bool((constTarget instanceof ConstObjectValue))) {
return constTarget.fields.$index(this.name);
}
- else if ($eq(constTarget.type, world.stringType) && this.name == 'length') {
+ else if ($notnull_bool($eq(constTarget.type, world.stringType) && this.name == 'length')) {
return new Value(this.type, ('' + constTarget.get$actualValue().length + ''), false, true, false);
}
}
@@ -10599,11 +10831,11 @@ FieldMember.prototype.set_ = function(context, node, target, value0, isDynamic)
return new Value(this.type, ('' + lhs.code + ' = ' + value0.code + ''), false, true, false);
}
FieldMember.prototype.get_$3 = function($0, $1, $2) {
- return this.get_($0, $1, $2, false);
+ return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), false);
}
;
FieldMember.prototype.set_$4 = function($0, $1, $2, $3) {
- return this.set_($0, $1, $2, $3, false);
+ return this.set_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false);
}
;
// ********** Code for PropertyMember **************
@@ -10613,8 +10845,9 @@ function PropertyMember(name0, declaringType0) {
// Initializers done
}
$inherits(PropertyMember, Member);
+PropertyMember.prototype.is$PropertyMember = function(){return this;};
PropertyMember.prototype.get$span = function() {
- return this.getter != null ? this.getter.get$span() : null;
+ return $notnull_bool(this.getter != null) ? this.getter.get$span() : null;
}
PropertyMember.prototype.get$canGet = function() {
return this.getter != null;
@@ -10635,18 +10868,18 @@ PropertyMember.prototype.providePropertySyntax = function() {
}
PropertyMember.prototype.get$isStatic = function() {
- return this.getter == null ? this.setter.isStatic : this.getter.isStatic;
+ return $notnull_bool(this.getter == null) ? this.setter.isStatic : this.getter.isStatic;
}
PropertyMember.prototype.get$isProperty = function() {
return true;
}
PropertyMember.prototype.get$returnType = function() {
- return this.getter == null ? this.setter.returnType : this.getter.returnType;
+ return $notnull_bool(this.getter == null) ? this.setter.returnType : this.getter.returnType;
}
PropertyMember.prototype.override = function(other) {
- if (!Member.prototype.override.call(this, other)) return false;
- if (other.get$isProperty() || other.get$isField()) {
- if (other.get$isProperty()) this.addFromParent(other);
+ if ($notnull_bool(!Member.prototype.override.call(this, other))) return false;
+ if ($notnull_bool(other.get$isProperty() || other.get$isField())) {
+ if ($notnull_bool(other.get$isProperty())) this.addFromParent(other);
return true;
}
else {
@@ -10655,7 +10888,7 @@ PropertyMember.prototype.override = function(other) {
}
}
PropertyMember.prototype.get_ = function(context, node, target, isDynamic) {
- if (this.getter == null) {
+ if ($notnull_bool(this.getter == null)) {
return target.invokeNoSuchMethod(context, ('get:' + this.name + ''), node);
}
return this.getter.invoke(context, node, target, Arguments.get$EMPTY(), false);
@@ -10664,23 +10897,23 @@ PropertyMember.prototype.set_ = function(context, node, target, value, isDynamic
return this.setter.invoke(context, node, target, new Arguments(null, [value]), isDynamic);
}
PropertyMember.prototype.addFromParent = function(parentMember) {
- if ((parentMember instanceof ConcreteMember)) {
+ if ($notnull_bool((parentMember instanceof ConcreteMember))) {
parentMember = parentMember.baseMember;
}
- if (this.getter == null) this.getter = parentMember.getter;
- if (this.setter == null) this.setter = parentMember.setter;
+ if ($notnull_bool(this.getter == null)) this.getter = parentMember.getter;
+ if ($notnull_bool(this.setter == null)) this.setter = parentMember.setter;
}
PropertyMember.prototype.resolve = function(inType) {
- if (this.getter != null) this.getter.resolve(inType);
- if (this.setter != null) this.setter.resolve(inType);
+ if ($notnull_bool(this.getter != null)) this.getter.resolve(inType);
+ if ($notnull_bool(this.setter != null)) this.setter.resolve(inType);
this.get$library()._addMember(this);
}
PropertyMember.prototype.get_$3 = function($0, $1, $2) {
- return this.get_($0, $1, $2, false);
+ return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), false);
}
;
PropertyMember.prototype.set_$4 = function($0, $1, $2, $3) {
- return this.set_($0, $1, $2, $3, false);
+ return this.set_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false);
}
;
// ********** Code for ConcreteMember **************
@@ -10694,8 +10927,8 @@ function ConcreteMember(name0, declaringType0, baseMember) {
for (var $i = 0;$i < $list.length; $i++) {
var p = $list.$index($i);
var newType = p.type.resolveTypeParams(declaringType0);
- if ($ne(newType, p.type)) {
- this.parameters.add(p.copyWithNewType(newType));
+ if ($notnull_bool($ne(newType, p.type))) {
+ this.parameters.add(p.copyWithNewType((newType && newType.is$lang_Type())));
}
else {
this.parameters.add(p);
@@ -10791,22 +11024,22 @@ ConcreteMember.prototype.set_ = function(context, node, target, value, isDynamic
ConcreteMember.prototype.invoke = function(context, node, target, args, isDynamic) {
var ret = this.baseMember.invoke(context, node, target, args, isDynamic);
var code = ret.code;
- if (this.get$isConstructor()) {
+ if ($notnull_bool(this.get$isConstructor())) {
code = code.replaceFirst(this.declaringType.get$genericType().get$jsname(), this.declaringType.get$jsname());
}
this.declaringType.genMethod(this);
return new Value(this.returnType, code, false, true, false);
}
ConcreteMember.prototype.get_$3 = function($0, $1, $2) {
- return this.get_($0, $1, $2, false);
+ return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), false);
}
;
ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) {
- return this.invoke($0, $1, $2, $3, false);
+ return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
}
;
ConcreteMember.prototype.set_$4 = function($0, $1, $2, $3) {
- return this.set_($0, $1, $2, $3, false);
+ return this.set_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false);
}
;
// ********** Code for MethodMember **************
@@ -10824,6 +11057,7 @@ function MethodMember(name0, declaringType0, definition) {
// Initializers done
}
$inherits(MethodMember, Member);
+MethodMember.prototype.is$MethodMember = function(){return this;};
MethodMember.prototype.get$definition = function() { return this.definition; };
MethodMember.prototype.set$definition = function(value) { return this.definition = value; };
MethodMember.prototype.get$returnType = function() { return this.returnType; };
@@ -10856,30 +11090,30 @@ MethodMember.prototype.get$canSet = function() {
return false;
}
MethodMember.prototype.get$span = function() {
- return this.definition == null ? null : this.definition.span;
+ return $notnull_bool(this.definition == null) ? null : this.definition.span;
}
MethodMember.prototype.get$constructorName = function() {
- if (this.definition.returnType == null) return '';
- if (this.definition.returnType.names != null) {
+ if ($notnull_bool(this.definition.returnType == null)) return '';
+ if ($notnull_bool(this.definition.returnType.names != null)) {
return this.definition.returnType.names.$index(0).get$name();
}
- else if ($ne(this.definition.returnType.get$name(), null)) {
+ else if ($notnull_bool($ne(this.definition.returnType.get$name(), null))) {
return this.definition.returnType.get$name().get$name();
}
world.internalError('no valid constructor name', this.definition.span);
}
MethodMember.prototype.get$functionType = function() {
- if (this._functionType == null) {
+ if ($notnull_bool(this._functionType == null)) {
this._functionType = this.declaringType.get$library().getOrAddFunctionType(this.name, this.definition, this.declaringType);
- if (this.parameters == null) {
+ if ($notnull_bool(this.parameters == null)) {
this.resolve(this.declaringType);
}
}
return this._functionType;
}
MethodMember.prototype.override = function(other) {
- if (!Member.prototype.override.call(this, other)) return false;
- if (other.get$isMethod()) {
+ if ($notnull_bool(!Member.prototype.override.call(this, other))) return false;
+ if ($notnull_bool(other.get$isMethod())) {
return true;
}
else {
@@ -10889,15 +11123,15 @@ MethodMember.prototype.override = function(other) {
}
MethodMember.prototype.canInvoke = function(context, args) {
var bareCount = args.get$bareCount();
- if (bareCount > this.parameters.length) return false;
- if (bareCount == this.parameters.length) {
- if (bareCount != args.get$length()) return false;
+ if ($notnull_bool(bareCount > this.parameters.length)) return false;
+ if ($notnull_bool(bareCount == this.parameters.length)) {
+ if ($notnull_bool(bareCount != args.get$length())) return false;
}
else {
- if (!this.parameters.$index(bareCount).get$isOptional()) return false;
+ if ($notnull_bool(!this.parameters.$index(bareCount).get$isOptional())) return false;
for (var i = bareCount;
- i < args.get$length(); i++) {
- if (this.indexOfParameter(args.getName(i)) < 0) {
+ $notnull_bool(i < args.get$length()); i++) {
+ if ($notnull_bool(this.indexOfParameter(args.getName(i)) < 0)) {
return false;
}
}
@@ -10906,9 +11140,9 @@ MethodMember.prototype.canInvoke = function(context, args) {
}
MethodMember.prototype.indexOfParameter = function(name0) {
for (var i = 0;
- i < this.parameters.length; i++) {
+ $notnull_bool(i < this.parameters.length); i++) {
var p = this.parameters.$index(i);
- if (p.get$isOptional() && $eq(p.get$name(), name0)) {
+ if ($notnull_bool(p.get$isOptional() && $eq(p.get$name(), name0))) {
return i;
}
}
@@ -10916,7 +11150,7 @@ MethodMember.prototype.indexOfParameter = function(name0) {
}
MethodMember.prototype.resolveType = function(node, isRequired) {
var type = this.declaringType.resolveType(node, isRequired);
- if (this.isStatic && type.get$hasTypeParams()) {
+ if ($notnull_bool(this.isStatic && type.get$hasTypeParams())) {
world.error('using type parameter in static context', node.span);
}
return type;
@@ -10939,33 +11173,55 @@ MethodMember.prototype.set_ = function(context, Node0, target, value, isDynamic)
MethodMember.prototype.get_ = function(context, node, target, isDynamic) {
this.declaringType.genMethod(this);
this._provideOptionalParamInfo = true;
- if (this.isStatic) {
- var type = this.declaringType.get$isTop() ? '' : ('' + this.declaringType.get$jsname() + '.');
+ if ($notnull_bool(this.isStatic)) {
+ var type = $notnull_bool(this.declaringType.get$isTop()) ? '' : ('' + this.declaringType.get$jsname() + '.');
return new Value(this.get$functionType(), ('' + type + '' + this.get$jsname() + ''), false, true, false);
}
this._providePropertySyntax = true;
return new Value(this.get$functionType(), ('' + target.code + '.get\$' + this.get$jsname() + '()'), false, true, false);
}
MethodMember.prototype.namesInOrder = function(args) {
- if (!args.get$hasNames()) return true;
+ if ($notnull_bool(!args.get$hasNames())) return true;
var lastParameter = null;
for (var i = args.get$bareCount();
- i < this.parameters.length; i++) {
- var p = args.getIndexOfName(this.parameters.$index(i).get$name());
- if (p >= 0 && args.values.$index(p).needsTemp) {
- if (lastParameter != null && lastParameter > p) {
+ $notnull_bool(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(lastParameter != null && lastParameter > $assert_num(p))) {
+ return false;
+ }
+ lastParameter = $assert_num(p);
+ }
+ }
+ return true;
+}
+MethodMember.prototype.needsArgumentConversion = function(args) {
+ var $0;
+ var bareCount = args.get$bareCount();
+ for (var i = 0;
+ $notnull_bool(i < bareCount); i++) {
+ var arg = args.values.$index(i);
+ if ($notnull_bool(arg.needsConversion((($0 = this.parameters.$index(i).type) && $0.is$lang_Type())))) {
+ return false;
+ }
+ }
+ if ($notnull_bool(bareCount < this.parameters.length)) {
+ this.genParameterValues();
+ for (var i = bareCount;
+ $notnull_bool(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((($0 = this.parameters.$index(i).type) && $0.is$lang_Type())))) {
return false;
}
- lastParameter = p;
}
}
return true;
}
MethodMember._argCountMsg = function(actual, expected, atLeast) {
- return 'wrong number of arguments, expected ' + ('' + (atLeast ? "at least " : "") + '' + expected + ' but found ' + actual + '');
+ return 'wrong number of arguments, expected ' + ('' + ($notnull_bool(atLeast) ? "at least " : "") + '' + expected + ' but found ' + actual + '');
}
MethodMember.prototype._argError = function(context, node, target, args, msg) {
- if (this.isStatic || this.get$isConstructor()) {
+ if ($notnull_bool(this.isStatic || this.get$isConstructor())) {
world.error(msg, node.span);
}
else {
@@ -10981,110 +11237,111 @@ MethodMember.prototype.genParameterValues = function() {
}
}
MethodMember.prototype.invoke = function(context, node, target, args, isDynamic) {
- if (this.parameters == null) {
+ var $0;
+ if ($notnull_bool(this.parameters == null)) {
world.info(('surprised to need to resolve: ' + this.declaringType.name + '.' + this.name + ''));
this.resolve(this.declaringType);
}
this.declaringType.genMethod(this);
- if (this.isStatic || this.isFactory) {
+ if ($notnull_bool(this.isStatic || this.isFactory)) {
this.declaringType.markUsed();
}
- if (!this.namesInOrder(args)) {
+ if ($notnull_bool(!this.namesInOrder(args))) {
return context.findMembers(this.name).invokeOnVar(context, node, target, args);
}
var argsCode = [];
- if (target != null && (this.get$isConstructor() || target.isSuper)) {
+ if ($notnull_bool(target != null && (this.get$isConstructor() || target.isSuper))) {
argsCode.add('this');
}
var bareCount = args.get$bareCount();
for (var i = 0;
- i < bareCount; i++) {
+ $notnull_bool(i < bareCount); i++) {
var arg = args.values.$index(i);
- if (i >= this.parameters.length) {
+ if ($notnull_bool(i >= this.parameters.length)) {
var msg = MethodMember._argCountMsg(args.get$length(), this.parameters.length, false);
- return this._argError(context, node, target, args, msg);
+ return this._argError(context, node, target, args, $assert_String(msg));
}
- arg = arg.convertTo(context, this.parameters.$index(i).type, node, isDynamic);
- if (this.isConst && arg.get$isConst()) {
+ arg = arg.convertTo(context, (($0 = this.parameters.$index(i).type) && $0.is$lang_Type()), node, isDynamic);
+ if ($notnull_bool(this.isConst && arg.get$isConst())) {
argsCode.add(arg.canonicalCode);
}
else {
argsCode.add(arg.code);
}
}
- if (bareCount < this.parameters.length) {
+ if ($notnull_bool(bareCount < this.parameters.length)) {
this.genParameterValues();
var namedArgsUsed = 0;
for (var i = bareCount;
- i < this.parameters.length; i++) {
- var arg = args.getValue(this.parameters.$index(i).get$name());
- if (arg == null) {
+ $notnull_bool(i < this.parameters.length); i++) {
+ var arg = args.getValue($assert_String(this.parameters.$index(i).get$name()));
+ if ($notnull_bool(arg == null)) {
arg = this.parameters.$index(i).get$value();
}
else {
- arg = arg.convertTo(context, this.parameters.$index(i).type, node, isDynamic);
+ arg = arg.convertTo(context, (($0 = this.parameters.$index(i).type) && $0.is$lang_Type()), node, isDynamic);
namedArgsUsed++;
}
- if (arg == null || !this.parameters.$index(i).get$isOptional()) {
+ if ($notnull_bool(arg == null || !this.parameters.$index(i).get$isOptional())) {
var msg = MethodMember._argCountMsg(Math.min(i, args.get$length()), i + 1, true);
- return this._argError(context, node, target, args, msg);
+ return this._argError(context, node, target, args, $assert_String(msg));
}
else {
- argsCode.add(this.isConst && arg.get$isConst() ? arg.canonicalCode : arg.code);
+ argsCode.add($notnull_bool(this.isConst && arg.get$isConst()) ? arg.canonicalCode : arg.code);
}
}
- if (namedArgsUsed < args.get$nameCount()) {
+ if ($notnull_bool(namedArgsUsed < args.get$nameCount())) {
var seen = new HashSetImplementation$String();
for (var i = bareCount;
- i < args.get$length(); i++) {
+ $notnull_bool(i < args.get$length()); i++) {
var name0 = args.getName(i);
- if (seen.contains(name0)) {
+ if ($notnull_bool(seen.contains(name0))) {
return this._argError(context, node, target, args, ('duplicate argument "' + name0 + '"'));
}
seen.add(name0);
- var p = this.indexOfParameter(name0);
- if (p < 0) {
+ var p = this.indexOfParameter($assert_String(name0));
+ if ($notnull_bool(p < 0)) {
return this._argError(context, node, target, args, ('method does not have optional parameter "' + name0 + '"'));
}
- else if (p < bareCount) {
+ else if ($notnull_bool(p < bareCount)) {
return this._argError(context, node, target, args, ('argument "' + name0 + '" passed as positional and named'));
}
}
world.internalError(('wrong named arguments calling ' + this.name + ''), node.span);
}
- Arguments.removeTrailingNulls(argsCode);
+ Arguments.removeTrailingNulls((argsCode && argsCode.is$List$Value()));
}
- var argsString = Strings.join(argsCode, ', ');
- if (this.get$isConstructor()) {
+ var argsString = Strings.join((argsCode && argsCode.is$List$String()), ', ');
+ if ($notnull_bool(this.get$isConstructor())) {
return this._invokeConstructor(context, node, target, args, argsString);
}
- if (this.name.startsWith('\$')) {
+ if ($notnull_bool(this.name.startsWith('\$'))) {
return this._invokeBuiltin(context, node, target, args, argsCode);
}
- if (target != null && target.isSuper) {
+ if ($notnull_bool(target != null && target.isSuper)) {
return new Value(this.returnType, ('' + this.declaringType.get$jsname() + '.prototype.' + this.get$jsname() + '.call(' + argsString + ')'), false, true, false);
}
- if (this.isFactory) {
+ if ($notnull_bool(this.isFactory)) {
return new Value(this.returnType, ('' + this.get$generatedFactoryName() + '(' + argsString + ')'), false, true, false);
}
- if (this.isStatic) {
- if (this.declaringType.get$isTop()) {
+ if ($notnull_bool(this.isStatic)) {
+ if ($notnull_bool(this.declaringType.get$isTop())) {
return new Value(this.returnType, ('' + this.get$jsname() + '(' + argsString + ')'), false, true, false);
}
return new Value(this.returnType, ('' + this.declaringType.get$jsname() + '.' + this.get$jsname() + '(' + argsString + ')'), false, true, false);
}
var code = ('' + target.code + '.' + this.get$jsname() + '(' + argsString + ')');
- if (target.get$isConst()) {
- if ((target instanceof GlobalValue)) {
+ if ($notnull_bool(target.get$isConst())) {
+ if ($notnull_bool((target instanceof GlobalValue))) {
target = target.exp;
}
- if (this.name == 'get\$length') {
- if ((target instanceof ConstListValue) || (target instanceof ConstMapValue)) {
+ if ($notnull_bool(this.name == 'get\$length')) {
+ if ($notnull_bool((target instanceof ConstListValue) || (target instanceof ConstMapValue))) {
code = ('' + target.values.length + '');
}
}
- else if (this.name == 'isEmpty') {
- if ((target instanceof ConstListValue) || (target instanceof ConstMapValue)) {
+ else if ($notnull_bool(this.name == 'isEmpty')) {
+ if ($notnull_bool((target instanceof ConstListValue) || (target instanceof ConstMapValue))) {
code = ('' + target.values.isEmpty() + '');
}
}
@@ -11093,14 +11350,14 @@ MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
}
MethodMember.prototype._invokeConstructor = function(context, node, target, args, argsString) {
this.declaringType.markUsed();
- if (target != null) {
- var code = (this.get$constructorName() != '') ? ('' + this.declaringType.get$jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')') : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')');
+ if ($notnull_bool(target != null)) {
+ var code = $notnull_bool((this.get$constructorName() != '')) ? ('' + this.declaringType.get$jsname() + '.' + this.get$constructorName() + '\$ctor.call(' + argsString + ')') : ('' + this.declaringType.get$jsname() + '.call(' + argsString + ')');
return new Value(this.declaringType, code, false, true, false);
}
else {
- var code = (this.get$constructorName() != '') ? ('new ' + this.declaringType.get$jsname() + '.' + this.get$constructorName() + '\$ctor(' + argsString + ')') : ('new ' + this.declaringType.get$jsname() + '(' + argsString + ')');
- if (this.isConst && node.get$isConst()) {
- return this._invokeConstConstructor(node, code, target, args);
+ var code = $notnull_bool((this.get$constructorName() != '')) ? ('new ' + this.declaringType.get$jsname() + '.' + this.get$constructorName() + '\$ctor(' + argsString + ')') : ('new ' + this.declaringType.get$jsname() + '(' + argsString + ')');
+ if ($notnull_bool(this.isConst && node.get$isConst())) {
+ return this._invokeConstConstructor(node, $assert_String(code), target, args);
}
else {
return new Value(this.declaringType, code, false, true, false);
@@ -11108,37 +11365,38 @@ MethodMember.prototype._invokeConstructor = function(context, node, target, args
}
}
MethodMember.prototype._invokeConstConstructor = function(node, code, target, args) {
+ var $0;
var fields = new HashMapImplementation$String$EvaluatedValue();
for (var i = 0;
- i < this.parameters.length; i++) {
+ $notnull_bool(i < this.parameters.length); i++) {
var param = this.parameters.$index(i).get$name();
- if (param.startsWith('this.')) {
+ if ($notnull_bool(param.startsWith('this.'))) {
var fname = param.substring(5);
var value = null;
- if (i < args.get$length()) {
+ if ($notnull_bool(i < args.get$length())) {
value = args.values.$index(i);
}
else {
- value = args.getValue(this.parameters.$index(i).get$name());
- if (value == null) {
+ value = args.getValue($assert_String(this.parameters.$index(i).get$name()));
+ if ($notnull_bool(value == null)) {
value = this.parameters.$index(i).get$value();
}
}
fields.$setindex(fname, value);
}
}
- if (this.definition.initializers != null) {
+ if ($notnull_bool(this.definition.initializers != null)) {
this.generator._pushBlock(false);
for (var j = 0;
- j < this.definition.formals.length; j++) {
+ $notnull_bool(j < this.definition.formals.length); j++) {
var name0 = this.definition.formals.$index(j).get$name().get$name();
var value = null;
- if (j < args.get$length()) {
+ if ($notnull_bool(j < args.get$length())) {
value = args.values.$index(j);
}
else {
- value = args.getValue(this.parameters.$index(j).get$name());
- if (value == null) {
+ value = args.getValue($assert_String(this.parameters.$index(j).get$name()));
+ if ($notnull_bool(value == null)) {
value = this.parameters.$index(j).get$value();
}
}
@@ -11147,14 +11405,14 @@ MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar
var $list = this.definition.initializers;
for (var $i = 0;$i < $list.length; $i++) {
var init = $list.$index($i);
- if ((init instanceof CallExpression)) {
- var delegateArgs = this.generator._makeArgs(init.get$arguments());
+ if ($notnull_bool((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 ($notnull_bool((init.target instanceof ThisExpression))) {
return value;
}
else {
- if ((value instanceof GlobalValue)) {
+ if ($notnull_bool((value instanceof GlobalValue))) {
value = value.exp;
}
var $list0 = value.fields.getKeys();
@@ -11175,7 +11433,7 @@ MethodMember.prototype._invokeConstConstructor = function(node, code, target, ar
var $list = this.declaringType.members.getValues();
for (var $i = this.declaringType.members.getValues().iterator(); $i.hasNext(); ) {
var f = $i.next();
- if ((f instanceof FieldMember) && !f.get$isStatic() && $ne(f.get$value(), null) && !fields.containsKey(f.get$name())) {
+ if ($notnull_bool((f instanceof FieldMember) && !f.get$isStatic() && $ne(f.get$value(), null) && !fields.containsKey(f.get$name()))) {
fields.$setindex(f.get$name(), f.computeValue());
}
}
@@ -11186,19 +11444,19 @@ MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar
return arg.get$isConst();
})
);
- if (this.declaringType.get$isNum()) {
- if (!allConst) {
+ if ($notnull_bool(this.declaringType.get$isNum())) {
+ if ($notnull_bool(!allConst)) {
var code;
- if (this.name == '\$negate') {
+ if ($notnull_bool(this.name == '\$negate')) {
code = ('-' + target.code + '');
}
- else if (this.name == '\$bit_not') {
+ else if ($notnull_bool(this.name == '\$bit_not')) {
code = ('~' + target.code + '');
}
- else if (this.name == '\$truncdiv') {
+ else if ($notnull_bool(this.name == '\$truncdiv')) {
code = ('' + this.name + '(' + target.code + ', ' + argsCode.$index(0) + ')');
}
- else if (this.name == '\$mod') {
+ else if ($notnull_bool(this.name == '\$mod')) {
code = ('' + this.name + '(' + target.code + ', ' + argsCode.$index(0) + ')');
}
else {
@@ -11210,10 +11468,10 @@ MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar
else {
var value;
var val0, val1, ival0, ival1;
- val0 = target.get$dynamic().get$actualValue();
+ val0 = $assert_num(target.get$dynamic().get$actualValue());
ival0 = val0.toInt();
- if (args.values.length > 0) {
- val1 = args.values.$index(0).get$dynamic().get$actualValue();
+ if ($notnull_bool(args.values.length > 0)) {
+ val1 = $assert_num(args.values.$index(0).get$dynamic().get$actualValue());
ival1 = val1.toInt();
}
switch (this.name) {
@@ -11321,16 +11579,16 @@ MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar
return EvaluatedValue.EvaluatedValue$factory(this.returnType, value, ("" + value + ""), node.span);
}
}
- else if (this.declaringType.get$isString()) {
- if (this.name == '\$index') {
+ else if ($notnull_bool(this.declaringType.get$isString())) {
+ if ($notnull_bool(this.name == '\$index')) {
return new Value(this.declaringType, ('' + target.code + '[' + argsCode.$index(0) + ']'), false, true, false);
}
- else if (this.name == '\$add') {
- if (allConst) {
+ else if ($notnull_bool(this.name == '\$add')) {
+ if ($notnull_bool(allConst)) {
var val0 = target.get$dynamic().get$actualValue();
val0 = val0.substring(1, val0.length - 1);
var val1 = args.values.$index(0).get$dynamic().get$actualValue();
- if (args.values.$index(0).type.get$isString()) {
+ if ($notnull_bool(args.values.$index(0).type.get$isString())) {
val1 = val1.substring(1, val1.length - 1);
}
var value = ('' + val0 + '' + val1 + '');
@@ -11341,33 +11599,33 @@ MethodMember.prototype._invokeBuiltin = function(context, node, target, args, ar
return new Value(this.declaringType, ('' + target.code + ' + ' + argsCode.$index(0) + ''), false, true, false);
}
}
- else if (this.declaringType.get$isNativeType()) {
- if (this.name == '\$index') {
+ else if ($notnull_bool(this.declaringType.get$isNativeType())) {
+ if ($notnull_bool(this.name == '\$index')) {
return new Value(null, ('' + target.code + '[' + argsCode.$index(0) + ']'), false, true, false);
}
- else if (this.name == '\$setindex') {
+ else if ($notnull_bool(this.name == '\$setindex')) {
return new Value(null, ('' + target.code + '[' + argsCode.$index(0) + '] = ' + argsCode.$index(1) + ''), false, true, false);
}
}
- if (this.name == '\$eq' || this.name == '\$ne') {
- var op = this.name == '\$eq' ? '==' : '!=';
- if (allConst) {
+ if ($notnull_bool(this.name == '\$eq' || this.name == '\$ne')) {
+ var op = $notnull_bool(this.name == '\$eq') ? '==' : '!=';
+ if ($notnull_bool(allConst)) {
var val0 = target.get$dynamic().get$actualValue();
var val1 = args.values.$index(0).get$dynamic().get$actualValue();
- var newVal = this.name == '\$eq' ? $eq(val0, val1) : $ne(val0, val1);
+ var newVal = $notnull_bool(this.name == '\$eq') ? $eq(val0, val1) : $ne(val0, val1);
return EvaluatedValue.EvaluatedValue$factory(world.boolType, newVal, ("" + newVal + ""), node.span);
}
- if ($eq(argsCode.$index(0), 'null')) {
+ if ($notnull_bool($eq(argsCode.$index(0), 'null'))) {
return new Value(this.returnType, ('' + target.code + ' ' + op + ' null'), false, true, false);
}
- else if (target.type.get$isNum() || target.type.get$isString()) {
+ else if ($notnull_bool(target.type.get$isNum() || target.type.get$isString())) {
return new Value(this.returnType, ('' + target.code + ' ' + op + ' ' + argsCode.$index(0) + ''), false, true, false);
}
return new Value(this.returnType, ('' + this.name + '(' + target.code + ', ' + argsCode.$index(0) + ')'), false, true, false);
}
- if (this.name == '\$call') {
+ if ($notnull_bool(this.name == '\$call')) {
this.declaringType.markUsed();
- return new Value(this.returnType, ('' + target.code + '(' + Strings.join(argsCode, ", ") + ')'), false, true, false);
+ return new Value(this.returnType, ('' + target.code + '(' + Strings.join((argsCode && argsCode.is$List$String()), ", ") + ')'), false, true, false);
}
return target.invokeSpecial(this.get$jsname(), args, this.returnType);
}
@@ -11376,30 +11634,30 @@ MethodMember.prototype.resolve = function(inType) {
this.isConst = false;
this.isFactory = false;
this.isAbstract = false;
- if (this.definition.modifiers != null) {
+ if ($notnull_bool(this.definition.modifiers != null)) {
var $list = this.definition.modifiers;
for (var $i = 0;$i < $list.length; $i++) {
var mod = $list.$index($i);
- if (mod.kind == 85/*TokenKind.STATIC*/) {
- if (this.isStatic) {
+ if ($notnull_bool(mod.kind == 86/*TokenKind.STATIC*/)) {
+ if ($notnull_bool(this.isStatic)) {
world.error('duplicate static modifier', mod.get$span());
}
this.isStatic = true;
}
- else if (this.get$isConstructor() && mod.kind == 90/*TokenKind.CONST*/) {
- if (this.isConst) {
+ else if ($notnull_bool(this.get$isConstructor() && mod.kind == 91/*TokenKind.CONST*/)) {
+ if ($notnull_bool(this.isConst)) {
world.error('duplicate const modifier', mod.get$span());
}
this.isConst = true;
}
- else if (mod.kind == 74/*TokenKind.FACTORY*/) {
- if (this.isFactory) {
+ else if ($notnull_bool(mod.kind == 75/*TokenKind.FACTORY*/)) {
+ if ($notnull_bool(this.isFactory)) {
world.error('duplicate factory modifier', mod.get$span());
}
this.isFactory = true;
}
- else if (mod.kind == 70/*TokenKind.ABSTRACT*/) {
- if (this.isAbstract) {
+ else if ($notnull_bool(mod.kind == 71/*TokenKind.ABSTRACT*/)) {
+ if ($notnull_bool(this.isAbstract)) {
world.error('duplicate abstract modifier', mod.get$span());
}
this.isAbstract = true;
@@ -11409,25 +11667,25 @@ MethodMember.prototype.resolve = function(inType) {
}
}
}
- if (this.isFactory) {
+ if ($notnull_bool(this.isFactory)) {
this.isStatic = true;
}
- if (this.isAbstract) {
- if (this.definition.body != null) {
+ if ($notnull_bool(this.isAbstract)) {
+ if ($notnull_bool(this.definition.body != null)) {
world.error('abstract method can not have a body', this.definition.body.span);
}
- if (this.isStatic) {
+ if ($notnull_bool(this.isStatic)) {
world.error('static method can not be abstract', this.definition.span);
}
}
else {
}
- if (this.get$isConstructor()) {
+ if ($notnull_bool(this.get$isConstructor())) {
this.returnType = this.declaringType;
}
else {
this.returnType = inType.resolveType(this.definition.returnType, false);
- if (this.isStatic && this.returnType.get$hasTypeParams()) {
+ if ($notnull_bool(this.isStatic && this.returnType.get$hasTypeParams())) {
world.error('using type parameter in static context', this.definition.returnType.span);
}
}
@@ -11438,24 +11696,24 @@ MethodMember.prototype.resolve = function(inType) {
var param = new lang_Parameter(formal);
param.resolve(inType);
this.parameters.add(param);
- if (this.isStatic && param.type.get$hasTypeParams()) {
+ if ($notnull_bool(this.isStatic && param.type.get$hasTypeParams())) {
world.error('using type parameter in static context', formal.get$span());
}
}
- if (!this.isLambda) {
+ if ($notnull_bool(!this.isLambda)) {
this.get$library()._addMember(this);
}
}
MethodMember.prototype.get_$3 = function($0, $1, $2) {
- return this.get_($0, $1, $2, false);
+ return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), false);
}
;
MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) {
- return this.invoke($0, $1, $2, $3, false);
+ return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
}
;
MethodMember.prototype.set_$4 = function($0, $1, $2, $3) {
- return this.set_($0, $1, $2, $3, false);
+ return this.set_(($0 && $0.is$MethodGenerator()), $1, ($2 && $2.is$Value()), ($3 && $3.is$Value()), false);
}
;
// ********** Code for MemberSet **************
@@ -11490,34 +11748,34 @@ MemberSet.prototype.get$library = function() {
var $list = this.members;
for (var $i = 0;$i < $list.length; $i++) {
var m = $list.$index($i);
- if ($ne(m.declaringType.get$library(), ret)) return null;
+ if ($notnull_bool($ne(m.declaringType.get$library(), ret))) return null;
}
return ret;
}
MemberSet.prototype._makeError = function(node, target, action) {
- if (!target.type.get$isVar()) {
+ if ($notnull_bool(!target.type.get$isVar())) {
world.warning(('could not find applicable ' + action + ' for "' + this.name + '"'), node.span);
}
return new Value(null, ('' + target.code + '.' + this.jsname + '() /*no applicable ' + action + '*/'), false, true, false);
}
MemberSet.prototype.get$treatAsField = function() {
- if (this._treatAsField == null) {
+ if ($notnull_bool(this._treatAsField == null)) {
this._treatAsField = true;
var $list = this.members;
for (var $i = 0;$i < $list.length; $i++) {
var member = $list.$index($i);
- if (member.get$requiresFieldSyntax()) {
+ if ($notnull_bool(member.get$requiresFieldSyntax())) {
this._treatAsField = true;
break;
}
- if (member.get$prefersPropertySyntax()) {
+ if ($notnull_bool(member.get$prefersPropertySyntax())) {
this._treatAsField = false;
}
}
var $list = this.members;
for (var $i = 0;$i < $list.length; $i++) {
var member = $list.$index($i);
- if (this._treatAsField) {
+ if ($notnull_bool(this._treatAsField)) {
member.provideFieldSyntax();
}
else {
@@ -11528,14 +11786,15 @@ MemberSet.prototype.get$treatAsField = function() {
return this._treatAsField;
}
MemberSet.prototype.get_ = function(context, node, target, isDynamic) {
- if (this.members.length == 1) {
+ var $0;
+ if ($notnull_bool(this.members.length == 1)) {
return this.members.$index(0).get_(context, node, target, isDynamic);
}
var targets = this.members.filter((function (m) {
return m.get$canGet();
})
);
- if (targets.length == 1) {
+ if ($notnull_bool(targets.length == 1)) {
return targets.$index(0).get_(context, node, target, isDynamic);
}
var returnValue = null;
@@ -11544,11 +11803,11 @@ MemberSet.prototype.get_ = function(context, node, target, isDynamic) {
var value = member.get_(context, node, target, true);
returnValue = this._tryUnion(returnValue, value, node);
}
- if (returnValue == null) {
+ if ($notnull_bool(returnValue == null)) {
return this._makeError(node, target, 'getter');
}
- if (returnValue.code == null) {
- if (this.get$treatAsField()) {
+ if ($notnull_bool(returnValue.code == null)) {
+ if ($notnull_bool(this.get$treatAsField())) {
return new Value(returnValue.type, ('' + target.code + '.' + this.jsname + ''), false, true, false);
}
else {
@@ -11558,27 +11817,28 @@ MemberSet.prototype.get_ = function(context, node, target, isDynamic) {
return returnValue;
}
MemberSet.prototype.set_ = function(context, node, target, value, isDynamic) {
- if (this.members.length == 1) {
+ var $0;
+ if ($notnull_bool(this.members.length == 1)) {
return this.members.$index(0).set_(context, node, target, value, isDynamic);
}
var targets = this.members.filter((function (m) {
return m.get$canSet();
})
);
- if (targets.length == 1) {
+ if ($notnull_bool(targets.length == 1)) {
return targets.$index(0).set_(context, node, target, value, isDynamic);
}
var returnValue = null;
for (var $i = targets.iterator(); $i.hasNext(); ) {
var member = $i.next();
var res = member.set_(context, node, target, value, true);
- returnValue = this._tryUnion(returnValue, res, node);
+ returnValue = this._tryUnion(returnValue, (res && res.is$Value()), node);
}
- if (returnValue == null) {
+ if ($notnull_bool(returnValue == null)) {
return this._makeError(node, target, 'setter');
}
- if (returnValue.code == null) {
- if (this.get$treatAsField()) {
+ if ($notnull_bool(returnValue.code == null)) {
+ if ($notnull_bool(this.get$treatAsField())) {
return new Value(returnValue.type, ('' + target.code + '.' + this.jsname + ' = ' + value.code + ''), false, true, false);
}
else {
@@ -11588,27 +11848,28 @@ MemberSet.prototype.set_ = function(context, node, target, value, isDynamic) {
return returnValue;
}
MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) {
- if (this.members.length == 1) {
+ var $0;
+ if ($notnull_bool(this.members.length == 1)) {
return this.members.$index(0).invoke(context, node, target, args, isDynamic);
}
var targets = this.members.filter((function (m) {
return m.canInvoke(context, args);
})
);
- if (targets.length == 1) {
+ if ($notnull_bool(targets.length == 1)) {
return targets.$index(0).invoke(context, node, target, args, isDynamic);
}
var returnValue = null;
for (var $i = targets.iterator(); $i.hasNext(); ) {
var member = $i.next();
var res = member.invoke(context, node, target, args, true);
- returnValue = this._tryUnion(returnValue, res, node);
+ returnValue = this._tryUnion(returnValue, (res && res.is$Value()), node);
}
- if (returnValue == null) {
+ if ($notnull_bool(returnValue == null)) {
return this._makeError(node, target, 'method');
}
- if (returnValue.code == null) {
- if (this.name.startsWith('\$')) {
+ if ($notnull_bool(returnValue.code == null)) {
+ if ($notnull_bool(this.name.startsWith('\$'))) {
return target.invokeSpecial(this.name, args, returnValue.type);
}
else {
@@ -11621,13 +11882,13 @@ MemberSet.prototype.invokeOnVar = function(context, node, target, args) {
return this.getVarMember(context, node, args).invoke(context, node, target, args);
}
MemberSet.prototype._tryUnion = function(x, y, node) {
- if (x == null) return y;
+ if ($notnull_bool(x == null)) return y;
var type = lang_Type.union(x.type, y.type);
- if (x.code == y.code) {
- if ($eq(type, x.type)) {
+ if ($notnull_bool(x.code == y.code)) {
+ if ($notnull_bool($eq(type, x.type))) {
return x;
}
- else if (x.get$isConst() || y.get$isConst()) {
+ else if ($notnull_bool(x.get$isConst() || y.get$isConst())) {
world.internalError("unexpected: union of const values ");
}
else {
@@ -11639,36 +11900,36 @@ MemberSet.prototype._tryUnion = function(x, y, node) {
}
}
MemberSet.prototype.getVarMember = function(context, node, args) {
- if (world.objectType.varStubs == null) {
+ if ($notnull_bool(world.objectType.varStubs == null)) {
world.objectType.varStubs = $map([]);
}
var stubName = _getCallStubName(this.name, args);
var stub = world.objectType.varStubs.$index(stubName);
- if (stub == null) {
+ if ($notnull_bool(stub == null)) {
var mset = context.findMembers(this.name).members;
var targets = mset.filter((function (m) {
return m.canInvoke(context, args);
})
);
- var returnType = reduce(map(targets, (function (t) {
+ var returnType = reduce(map((targets && targets.is$Iterable()), (function (t) {
return t.get$returnType();
})
), lang_Type.union);
- stub = new VarMethodSet(stubName, targets, args, returnType);
+ stub = new VarMethodSet($assert_String(stubName), targets, args, returnType);
world.objectType.varStubs.$setindex(stubName, stub);
}
return stub;
}
MemberSet.prototype.get_$3 = function($0, $1, $2) {
- return this.get_($0, $1, $2, false);
+ return this.get_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), false);
}
;
MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) {
- return this.invoke($0, $1, $2, $3, false);
+ return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()), false);
}
;
MemberSet.prototype.set_$4 = function($0, $1, $2, $3) {
- return this.set_($0, $1, $2, $3, false);
+ return this.set_(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Value()), false);
}
;
// ********** Code for FactoryMap **************
@@ -11678,7 +11939,7 @@ function FactoryMap() {
}
FactoryMap.prototype.getFactoriesFor = function(typeName) {
var ret = this.factories.$index(typeName);
- if (ret == null) {
+ if ($notnull_bool(ret == null)) {
ret = $map([]);
this.factories.$setindex(typeName, ret);
}
@@ -11715,8 +11976,8 @@ lang_Token.prototype.get$text = function() {
lang_Token.prototype.toString = function() {
var kindText = TokenKind.kindToString(this.kind);
var actualText = this.get$text();
- if ($ne(kindText, actualText)) {
- if (actualText.length > 10) {
+ if ($notnull_bool($ne(kindText, actualText))) {
+ if ($notnull_bool(actualText.length > 10)) {
actualText = actualText.substring(0, 8) + '...';
}
return ('' + kindText + '(' + actualText + ')');
@@ -11734,42 +11995,43 @@ function SourceFile(filename, _text) {
this._text = _text;
// Initializers done
}
+SourceFile.prototype.is$SourceFile = function(){return this;};
SourceFile.prototype.get$text = function() {
return this._text;
}
SourceFile.prototype.get$lineStarts = function() {
- if (this._lineStarts == null) {
+ if ($notnull_bool(this._lineStarts == null)) {
var starts = [0];
var index = 0;
- while (index < this.get$text().length) {
+ while ($notnull_bool(index < this.get$text().length)) {
index = this.get$text().indexOf('\n', index) + 1;
- if (index <= 0) break;
+ if ($notnull_bool(index <= 0)) break;
starts.add(index);
}
starts.add(this.get$text().length + 1);
- this._lineStarts = starts;
+ this._lineStarts = (starts && starts.is$List$int());
}
return this._lineStarts;
}
SourceFile.prototype.getLine = function(position) {
var starts = this.get$lineStarts();
for (var i = 0;
- i < starts.length; i++) {
- if (starts.$index(i) > position) return i - 1;
+ $notnull_bool(i < starts.length); i++) {
+ if ($notnull_bool(starts.$index(i) > position)) return i - 1;
}
world.internalError('bad position');
}
SourceFile.prototype.getColumn = function(line, position) {
- return position - this.get$lineStarts().$index(line);
+ return position - $assert_num(this.get$lineStarts().$index(line));
}
SourceFile.prototype.getLocationMessage = function(message, start, end, includeText) {
var line = this.getLine(start);
- var column = this.getColumn(line, start);
+ var column = this.getColumn($assert_num(line), start);
var buf = new StringBufferImpl(('' + this.filename + ':' + (line + 1) + ':' + (column + 1) + ': ' + message + ''));
- if (includeText) {
+ if ($notnull_bool(includeText)) {
buf.add('\n');
var textLine;
- if ((line + 2) < this._lineStarts.length) {
+ if ($notnull_bool((line + 2) < this._lineStarts.length)) {
textLine = this.get$text().substring(this._lineStarts.$index(line), this._lineStarts.$index(line + 1));
}
else {
@@ -11777,18 +12039,18 @@ SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
}
buf.add(textLine);
var i = 0;
- for (; i < column; i++) {
+ for (; $notnull_bool(i < $assert_num(column)); i++) {
buf.add(' ');
}
- var toColumn = Math.min(column + (end - start), textLine.length);
- for (; i < toColumn; i++) {
+ var toColumn = Math.min($assert_num(column + (end - start)), textLine.length);
+ for (; $notnull_bool(i < toColumn); i++) {
buf.add('^');
}
}
return buf.toString();
}
SourceFile.prototype.compareTo = function(other) {
- if (this.orderInLibrary != null && other.orderInLibrary != null) {
+ if ($notnull_bool(this.orderInLibrary != null && other.orderInLibrary != null)) {
return this.orderInLibrary - other.orderInLibrary;
}
else {
@@ -11802,6 +12064,7 @@ function SourceSpan(file, start, end) {
this.end = end;
// Initializers done
}
+SourceSpan.prototype.is$SourceSpan = function(){return this;};
SourceSpan.prototype.get$text = function() {
return this.file.get$text().substring(this.start, this.end);
}
@@ -11810,13 +12073,13 @@ SourceSpan.prototype.toMessageString = function(message) {
}
SourceSpan.prototype.get$locationText = function() {
var line = this.file.getLine(this.start);
- var column = this.file.getColumn(line, this.start);
+ var column = this.file.getColumn($assert_num(line), this.start);
return ('' + this.file.filename + ':' + (line + 1) + ':' + (column + 1) + '');
}
SourceSpan.prototype.compareTo = function(other) {
- if ($eq(this.file, other.file)) {
+ if ($notnull_bool($eq(this.file, other.file))) {
var d = this.start - other.start;
- return d == 0 ? (this.end - other.end) : d;
+ return $notnull_bool(d == 0) ? (this.end - other.end) : d;
}
return this.file.compareTo(other.file);
}
@@ -11833,7 +12096,7 @@ InterpStack.prototype.pop = function() {
}
InterpStack.push = function(stack, quote0, isMultiline0) {
var newStack = new InterpStack(stack, quote0, isMultiline0);
- if (stack != null) newStack.previous = stack;
+ if ($notnull_bool(stack != null)) newStack.previous = stack;
return newStack;
}
// ********** Code for TokenizerBase **************
@@ -11846,7 +12109,7 @@ function TokenizerBase(_source, _skipWhitespace, _index) {
}
$inherits(TokenizerBase, TokenizerHelpers);
TokenizerBase.prototype._nextChar = function() {
- if (this._lang_index < this._text.length) {
+ if ($notnull_bool(this._lang_index < this._text.length)) {
return this._text.charCodeAt(this._lang_index++);
}
else {
@@ -11854,7 +12117,7 @@ TokenizerBase.prototype._nextChar = function() {
}
}
TokenizerBase.prototype._peekChar = function() {
- if (this._lang_index < this._text.length) {
+ if ($notnull_bool(this._lang_index < this._text.length)) {
return this._text.charCodeAt(this._lang_index);
}
else {
@@ -11862,8 +12125,8 @@ TokenizerBase.prototype._peekChar = function() {
}
}
TokenizerBase.prototype._maybeEatChar = function(ch) {
- if (this._lang_index < this._text.length) {
- if (this._text.charCodeAt(this._lang_index) == ch) {
+ if ($notnull_bool(this._lang_index < this._text.length)) {
+ if ($notnull_bool(this._text.charCodeAt(this._lang_index) == ch)) {
this._lang_index++;
return true;
}
@@ -11879,11 +12142,11 @@ TokenizerBase.prototype._finishToken = function(kind) {
return new lang_Token(kind, this._source, this._startIndex, this._lang_index);
}
TokenizerBase.prototype._errorToken = function() {
- return this._finishToken(64/*TokenKind.ERROR*/);
+ return this._finishToken(65/*TokenKind.ERROR*/);
}
TokenizerBase.prototype.finishWhitespace = function() {
- while (this._lang_index < this._text.length) {
- if (!TokenizerHelpers.isWhitespace(this._text.charCodeAt(this._lang_index++))) {
+ while ($notnull_bool(this._lang_index < this._text.length)) {
+ if ($notnull_bool(!TokenizerHelpers.isWhitespace(this._text.charCodeAt(this._lang_index++)))) {
this._lang_index--;
return this.next();
}
@@ -11891,39 +12154,39 @@ TokenizerBase.prototype.finishWhitespace = function() {
return this._finishToken(1/*TokenKind.END_OF_FILE*/);
}
TokenizerBase.prototype.finishHashBang = function() {
- while (true) {
+ while ($notnull_bool(true)) {
var ch = this._nextChar();
- if (ch == 0 || ch == 10 || ch == 13) {
+ if ($notnull_bool(ch == 0 || ch == 10 || ch == 13)) {
return this._finishToken(13/*TokenKind.HASHBANG*/);
}
}
}
TokenizerBase.prototype.finishSingleLineComment = function() {
- while (true) {
+ while ($notnull_bool(true)) {
var ch = this._nextChar();
- if (ch == 0 || ch == 10 || ch == 13) {
- if (this._skipWhitespace) {
+ if ($notnull_bool(ch == 0 || ch == 10 || ch == 13)) {
+ if ($notnull_bool(this._skipWhitespace)) {
return this.next();
}
else {
- return this._finishToken(63/*TokenKind.COMMENT*/);
+ return this._finishToken(64/*TokenKind.COMMENT*/);
}
}
}
}
TokenizerBase.prototype.finishMultiLineComment = function() {
- while (true) {
+ while ($notnull_bool(true)) {
var ch = this._nextChar();
- if (ch == 0) {
- return this._finishToken(66/*TokenKind.INCOMPLETE_COMMENT*/);
+ if ($notnull_bool(ch == 0)) {
+ return this._finishToken(67/*TokenKind.INCOMPLETE_COMMENT*/);
}
- else if (ch == 42) {
- if (this._maybeEatChar(47)) {
- if (this._skipWhitespace) {
+ else if ($notnull_bool(ch == 42)) {
+ if ($notnull_bool(this._maybeEatChar(47))) {
+ if ($notnull_bool(this._skipWhitespace)) {
return this.next();
}
else {
- return this._finishToken(63/*TokenKind.COMMENT*/);
+ return this._finishToken(64/*TokenKind.COMMENT*/);
}
}
}
@@ -11931,8 +12194,8 @@ TokenizerBase.prototype.finishMultiLineComment = function() {
return this._errorToken();
}
TokenizerBase.prototype.eatDigits = function() {
- while (this._lang_index < this._text.length) {
- if (TokenizerHelpers.isDigit(this._text.charCodeAt(this._lang_index))) {
+ while ($notnull_bool(this._lang_index < this._text.length)) {
+ if ($notnull_bool(TokenizerHelpers.isDigit(this._text.charCodeAt(this._lang_index)))) {
this._lang_index++;
}
else {
@@ -11941,8 +12204,8 @@ TokenizerBase.prototype.eatDigits = function() {
}
}
TokenizerBase.prototype.eatHexDigits = function() {
- while (this._lang_index < this._text.length) {
- if (TokenizerHelpers.isHexDigit(this._text.charCodeAt(this._lang_index))) {
+ while ($notnull_bool(this._lang_index < this._text.length)) {
+ if ($notnull_bool(TokenizerHelpers.isHexDigit(this._text.charCodeAt(this._lang_index)))) {
this._lang_index++;
}
else {
@@ -11951,7 +12214,7 @@ TokenizerBase.prototype.eatHexDigits = function() {
}
}
TokenizerBase.prototype.maybeEatHexDigit = function() {
- if (this._lang_index < this._text.length && TokenizerHelpers.isHexDigit(this._text.charCodeAt(this._lang_index))) {
+ if ($notnull_bool(this._lang_index < this._text.length && TokenizerHelpers.isHexDigit(this._text.charCodeAt(this._lang_index)))) {
this._lang_index++;
return true;
}
@@ -11959,53 +12222,55 @@ TokenizerBase.prototype.maybeEatHexDigit = function() {
}
TokenizerBase.prototype.finishHex = function() {
this.eatHexDigits();
- return this._finishToken(61/*TokenKind.HEX_NUMBER*/);
+ return this._finishToken(61/*TokenKind.HEX_INTEGER*/);
}
TokenizerBase.prototype.finishNumber = function() {
this.eatDigits();
- if (this._peekChar() == 46) {
+ if ($notnull_bool(this._peekChar() == 46)) {
this._nextChar();
- if (TokenizerHelpers.isDigit(this._peekChar())) {
+ if ($notnull_bool(TokenizerHelpers.isDigit(this._peekChar()))) {
this.eatDigits();
+ return this.finishNumberExtra(62/*TokenKind.DOUBLE*/);
}
else {
this._lang_index--;
}
}
- return this.finishNumberExtra();
+ return this.finishNumberExtra(60/*TokenKind.INTEGER*/);
}
-TokenizerBase.prototype.finishNumberExtra = function() {
- if (this._maybeEatChar(101) || this._maybeEatChar(69)) {
+TokenizerBase.prototype.finishNumberExtra = function(kind) {
+ if ($notnull_bool(this._maybeEatChar(101) || this._maybeEatChar(69))) {
+ kind = 62/*TokenKind.DOUBLE*/;
this._maybeEatChar(45);
this._maybeEatChar(43);
this.eatDigits();
}
- if (this._peekChar() != 0 && TokenizerHelpers.isIdentifierStart(this._peekChar())) {
+ if ($notnull_bool(this._peekChar() != 0 && TokenizerHelpers.isIdentifierStart(this._peekChar()))) {
this._nextChar();
return this._errorToken();
}
- return this._finishToken(60/*TokenKind.NUMBER*/);
+ return this._finishToken(kind);
}
TokenizerBase.prototype.finishMultilineString = function(quote) {
- while (true) {
+ while ($notnull_bool(true)) {
var ch = this._nextChar();
- if (ch == 0) {
- var kind = quote == 34 ? 67/*TokenKind.INCOMPLETE_MULTILINE_STRING_DQ*/ : 68/*TokenKind.INCOMPLETE_MULTILINE_STRING_SQ*/;
+ if ($notnull_bool(ch == 0)) {
+ var kind = $notnull_bool(quote == 34) ? 68/*TokenKind.INCOMPLETE_MULTILINE_STRING_DQ*/ : 69/*TokenKind.INCOMPLETE_MULTILINE_STRING_SQ*/;
return this._finishToken(kind);
}
- else if (ch == quote) {
- if (this._maybeEatChar(quote)) {
- if (this._maybeEatChar(quote)) {
+ else if ($notnull_bool(ch == quote)) {
+ if ($notnull_bool(this._maybeEatChar(quote))) {
+ if ($notnull_bool(this._maybeEatChar(quote))) {
return this._finishToken(58/*TokenKind.STRING*/);
}
}
}
- else if (ch == 36) {
+ else if ($notnull_bool(ch == 36)) {
this._interpStack = InterpStack.push(this._interpStack, quote, true);
- return this._finishToken(65/*TokenKind.INCOMPLETE_STRING*/);
+ return this._finishToken(66/*TokenKind.INCOMPLETE_STRING*/);
}
- else if (ch == 92) {
- if (!this.eatEscapeSequence()) {
+ else if ($notnull_bool(ch == 92)) {
+ if ($notnull_bool(!this.eatEscapeSequence())) {
return this._errorToken();
}
}
@@ -12013,11 +12278,12 @@ TokenizerBase.prototype.finishMultilineString = function(quote) {
}
TokenizerBase.prototype._finishOpenBrace = function() {
var $0;
- if (this._interpStack != null) {
- if (this._interpStack.depth == -1) {
+ if ($notnull_bool(this._interpStack != null)) {
+ if ($notnull_bool(this._interpStack.depth == -1)) {
this._interpStack.depth = 1;
}
else {
+ $assert(this._interpStack.depth >= 0, "_interpStack.depth >= 0", "tokenizer.dart", 257, 16);
($0 = this._interpStack).depth = $0.depth + 1;
}
}
@@ -12025,14 +12291,15 @@ TokenizerBase.prototype._finishOpenBrace = function() {
}
TokenizerBase.prototype._finishCloseBrace = function() {
var $0;
- if (this._interpStack != null) {
+ if ($notnull_bool(this._interpStack != null)) {
($0 = this._interpStack).depth = $0.depth - 1;
+ $assert(this._interpStack.depth >= 0, "_interpStack.depth >= 0", "tokenizer.dart", 267, 14);
}
return this._finishToken(7/*TokenKind.RBRACE*/);
}
TokenizerBase.prototype.finishString = function(quote) {
- if (this._maybeEatChar(quote)) {
- if (this._maybeEatChar(quote)) {
+ if ($notnull_bool(this._maybeEatChar(quote))) {
+ if ($notnull_bool(this._maybeEatChar(quote))) {
return this.finishMultilineString(quote);
}
else {
@@ -12042,51 +12309,51 @@ TokenizerBase.prototype.finishString = function(quote) {
return this.finishStringBody(quote);
}
TokenizerBase.prototype.finishRawString = function(quote) {
- if (this._maybeEatChar(quote)) {
- if (this._maybeEatChar(quote)) {
+ if ($notnull_bool(this._maybeEatChar(quote))) {
+ if ($notnull_bool(this._maybeEatChar(quote))) {
return this.finishMultilineRawString(quote);
}
else {
return this._finishToken(58/*TokenKind.STRING*/);
}
}
- while (true) {
+ while ($notnull_bool(true)) {
var ch = this._nextChar();
- if (ch == quote) {
+ if ($notnull_bool(ch == quote)) {
return this._finishToken(58/*TokenKind.STRING*/);
}
- else if (ch == 0) {
- return this._finishToken(65/*TokenKind.INCOMPLETE_STRING*/);
+ else if ($notnull_bool(ch == 0)) {
+ return this._finishToken(66/*TokenKind.INCOMPLETE_STRING*/);
}
}
}
TokenizerBase.prototype.finishMultilineRawString = function(quote) {
- while (true) {
+ while ($notnull_bool(true)) {
var ch = this._nextChar();
- if (ch == 0) {
- var kind = quote == 34 ? 67/*TokenKind.INCOMPLETE_MULTILINE_STRING_DQ*/ : 68/*TokenKind.INCOMPLETE_MULTILINE_STRING_SQ*/;
+ if ($notnull_bool(ch == 0)) {
+ var kind = $notnull_bool(quote == 34) ? 68/*TokenKind.INCOMPLETE_MULTILINE_STRING_DQ*/ : 69/*TokenKind.INCOMPLETE_MULTILINE_STRING_SQ*/;
return this._finishToken(kind);
}
- else if (ch == quote && this._maybeEatChar(quote) && this._maybeEatChar(quote)) {
+ else if ($notnull_bool(ch == quote && this._maybeEatChar(quote) && this._maybeEatChar(quote))) {
return this._finishToken(58/*TokenKind.STRING*/);
}
}
}
TokenizerBase.prototype.finishStringBody = function(quote) {
- while (true) {
+ while ($notnull_bool(true)) {
var ch = this._nextChar();
- if (ch == quote) {
+ if ($notnull_bool(ch == quote)) {
return this._finishToken(58/*TokenKind.STRING*/);
}
- else if (ch == 36) {
+ else if ($notnull_bool(ch == 36)) {
this._interpStack = InterpStack.push(this._interpStack, quote, false);
- return this._finishToken(65/*TokenKind.INCOMPLETE_STRING*/);
+ return this._finishToken(66/*TokenKind.INCOMPLETE_STRING*/);
}
- else if (ch == 0) {
- return this._finishToken(65/*TokenKind.INCOMPLETE_STRING*/);
+ else if ($notnull_bool(ch == 0)) {
+ return this._finishToken(66/*TokenKind.INCOMPLETE_STRING*/);
}
- else if (ch == 92) {
- if (!this.eatEscapeSequence()) {
+ else if ($notnull_bool(ch == 92)) {
+ if ($notnull_bool(!this.eatEscapeSequence())) {
return this._errorToken();
}
}
@@ -12101,11 +12368,11 @@ TokenizerBase.prototype.eatEscapeSequence = function() {
case 117:
- if (this._maybeEatChar(123)) {
+ if ($notnull_bool(this._maybeEatChar(123))) {
var start = this._lang_index;
this.eatHexDigits();
var chars = this._lang_index - start;
- if (chars > 0 && chars <= 6 && this._maybeEatChar(125)) {
+ if ($notnull_bool(chars > 0 && chars <= 6 && this._maybeEatChar(125))) {
hex = this._text.substring(start, start + chars);
break;
}
@@ -12114,7 +12381,7 @@ TokenizerBase.prototype.eatEscapeSequence = function() {
}
}
else {
- if (this.maybeEatHexDigit() && this.maybeEatHexDigit() && this.maybeEatHexDigit() && this.maybeEatHexDigit()) {
+ if ($notnull_bool(this.maybeEatHexDigit() && this.maybeEatHexDigit() && this.maybeEatHexDigit() && this.maybeEatHexDigit())) {
hex = this._text.substring(this._lang_index - 4, this._lang_index);
break;
}
@@ -12132,27 +12399,27 @@ TokenizerBase.prototype.eatEscapeSequence = function() {
return n < 0xD800 || n > 0xDFFF && n <= 0x10FFFF;
}
TokenizerBase.prototype.finishDot = function() {
- if (TokenizerHelpers.isDigit(this._peekChar())) {
+ if ($notnull_bool(TokenizerHelpers.isDigit(this._peekChar()))) {
this.eatDigits();
- return this.finishNumberExtra();
+ return this.finishNumberExtra(62/*TokenKind.DOUBLE*/);
}
else {
return this._finishToken(14/*TokenKind.DOT*/);
}
}
TokenizerBase.prototype.finishIdentifier = function() {
- while (this._lang_index < this._text.length) {
- if (!TokenizerHelpers.isIdentifierPart(this._text.charCodeAt(this._lang_index++))) {
+ while ($notnull_bool(this._lang_index < this._text.length)) {
+ if ($notnull_bool(!TokenizerHelpers.isIdentifierPart(this._text.charCodeAt(this._lang_index++)))) {
this._lang_index--;
break;
}
}
var kind = this.getIdentifierKind();
- if (this._interpStack != null && this._interpStack.depth == -1) {
+ if ($notnull_bool(this._interpStack != null && this._interpStack.depth == -1)) {
this._interpStack.depth = 0;
}
- if (kind == 69/*TokenKind.IDENTIFIER*/) {
- return this._finishToken(69/*TokenKind.IDENTIFIER*/);
+ if ($notnull_bool(kind == 70/*TokenKind.IDENTIFIER*/)) {
+ return this._finishToken(70/*TokenKind.IDENTIFIER*/);
}
else {
return this._finishToken(kind);
@@ -12166,10 +12433,10 @@ function Tokenizer(source, skipWhitespace, index) {
$inherits(Tokenizer, TokenizerBase);
Tokenizer.prototype.next = function() {
this._startIndex = this._lang_index;
- if (this._interpStack != null && this._interpStack.depth == 0) {
+ if ($notnull_bool(this._interpStack != null && this._interpStack.depth == 0)) {
var istack = this._interpStack;
this._interpStack = this._interpStack.pop();
- if (istack.isMultiline) {
+ if ($notnull_bool(istack.isMultiline)) {
return this.finishMultilineString(istack.quote);
}
else {
@@ -12192,8 +12459,8 @@ Tokenizer.prototype.next = function() {
case 33:
- if (this._maybeEatChar(61)) {
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(51/*TokenKind.NE_STRICT*/);
}
else {
@@ -12210,7 +12477,7 @@ Tokenizer.prototype.next = function() {
case 35:
- if (this._maybeEatChar(33)) {
+ if ($notnull_bool(this._maybeEatChar(33))) {
return this.finishHashBang();
}
else {
@@ -12219,10 +12486,10 @@ Tokenizer.prototype.next = function() {
case 36:
- if (this._maybeEatChar(34)) {
+ if ($notnull_bool(this._maybeEatChar(34))) {
return this.finishString(34);
}
- else if (this._maybeEatChar(39)) {
+ else if ($notnull_bool(this._maybeEatChar(39))) {
return this.finishString(39);
}
else {
@@ -12231,7 +12498,7 @@ Tokenizer.prototype.next = function() {
case 37:
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(32/*TokenKind.ASSIGN_MOD*/);
}
else {
@@ -12240,10 +12507,10 @@ Tokenizer.prototype.next = function() {
case 38:
- if (this._maybeEatChar(38)) {
+ if ($notnull_bool(this._maybeEatChar(38))) {
return this._finishToken(35/*TokenKind.AND*/);
}
- else if (this._maybeEatChar(61)) {
+ else if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(23/*TokenKind.ASSIGN_AND*/);
}
else {
@@ -12264,7 +12531,7 @@ Tokenizer.prototype.next = function() {
case 42:
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(29/*TokenKind.ASSIGN_MUL*/);
}
else {
@@ -12273,10 +12540,10 @@ Tokenizer.prototype.next = function() {
case 43:
- if (this._maybeEatChar(43)) {
+ if ($notnull_bool(this._maybeEatChar(43))) {
return this._finishToken(16/*TokenKind.INCR*/);
}
- else if (this._maybeEatChar(61)) {
+ else if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(27/*TokenKind.ASSIGN_ADD*/);
}
else {
@@ -12289,10 +12556,10 @@ Tokenizer.prototype.next = function() {
case 45:
- if (this._maybeEatChar(45)) {
+ if ($notnull_bool(this._maybeEatChar(45))) {
return this._finishToken(17/*TokenKind.DECR*/);
}
- else if (this._maybeEatChar(61)) {
+ else if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(28/*TokenKind.ASSIGN_SUB*/);
}
else {
@@ -12301,8 +12568,8 @@ Tokenizer.prototype.next = function() {
case 46:
- if (this._maybeEatChar(46)) {
- if (this._maybeEatChar(46)) {
+ if ($notnull_bool(this._maybeEatChar(46))) {
+ if ($notnull_bool(this._maybeEatChar(46))) {
return this._finishToken(15/*TokenKind.ELLIPSIS*/);
}
else {
@@ -12315,13 +12582,13 @@ Tokenizer.prototype.next = function() {
case 47:
- if (this._maybeEatChar(42)) {
+ if ($notnull_bool(this._maybeEatChar(42))) {
return this.finishMultiLineComment();
}
- else if (this._maybeEatChar(47)) {
+ else if ($notnull_bool(this._maybeEatChar(47))) {
return this.finishSingleLineComment();
}
- else if (this._maybeEatChar(61)) {
+ else if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(30/*TokenKind.ASSIGN_DIV*/);
}
else {
@@ -12330,10 +12597,10 @@ Tokenizer.prototype.next = function() {
case 48:
- if (this._maybeEatChar(88)) {
+ if ($notnull_bool(this._maybeEatChar(88))) {
return this.finishHex();
}
- else if (this._maybeEatChar(120)) {
+ else if ($notnull_bool(this._maybeEatChar(120))) {
return this.finishHex();
}
else {
@@ -12350,15 +12617,15 @@ Tokenizer.prototype.next = function() {
case 60:
- if (this._maybeEatChar(60)) {
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(60))) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(24/*TokenKind.ASSIGN_SHL*/);
}
else {
return this._finishToken(39/*TokenKind.SHL*/);
}
}
- else if (this._maybeEatChar(61)) {
+ else if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(54/*TokenKind.LTE*/);
}
else {
@@ -12367,15 +12634,15 @@ Tokenizer.prototype.next = function() {
case 61:
- if (this._maybeEatChar(61)) {
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(50/*TokenKind.EQ_STRICT*/);
}
else {
return this._finishToken(48/*TokenKind.EQ*/);
}
}
- else if (this._maybeEatChar(62)) {
+ else if ($notnull_bool(this._maybeEatChar(62))) {
return this._finishToken(9/*TokenKind.ARROW*/);
}
else {
@@ -12384,15 +12651,15 @@ Tokenizer.prototype.next = function() {
case 62:
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(55/*TokenKind.GTE*/);
}
- else if (this._maybeEatChar(62)) {
- if (this._maybeEatChar(61)) {
+ else if ($notnull_bool(this._maybeEatChar(62))) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(25/*TokenKind.ASSIGN_SAR*/);
}
- else if (this._maybeEatChar(62)) {
- if (this._maybeEatChar(61)) {
+ else if ($notnull_bool(this._maybeEatChar(62))) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(26/*TokenKind.ASSIGN_SHR*/);
}
else {
@@ -12413,10 +12680,10 @@ Tokenizer.prototype.next = function() {
case 64:
- if (this._maybeEatChar(34)) {
+ if ($notnull_bool(this._maybeEatChar(34))) {
return this.finishRawString(34);
}
- else if (this._maybeEatChar(39)) {
+ else if ($notnull_bool(this._maybeEatChar(39))) {
return this.finishRawString(39);
}
else {
@@ -12425,8 +12692,8 @@ Tokenizer.prototype.next = function() {
case 91:
- if (this._maybeEatChar(93)) {
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(93))) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(57/*TokenKind.SETINDEX*/);
}
else {
@@ -12443,7 +12710,7 @@ Tokenizer.prototype.next = function() {
case 94:
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(22/*TokenKind.ASSIGN_XOR*/);
}
else {
@@ -12456,10 +12723,10 @@ Tokenizer.prototype.next = function() {
case 124:
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(21/*TokenKind.ASSIGN_OR*/);
}
- else if (this._maybeEatChar(124)) {
+ else if ($notnull_bool(this._maybeEatChar(124))) {
return this._finishToken(34/*TokenKind.OR*/);
}
else {
@@ -12472,8 +12739,8 @@ Tokenizer.prototype.next = function() {
case 126:
- if (this._maybeEatChar(47)) {
- if (this._maybeEatChar(61)) {
+ if ($notnull_bool(this._maybeEatChar(47))) {
+ if ($notnull_bool(this._maybeEatChar(61))) {
return this._finishToken(31/*TokenKind.ASSIGN_TRUNCDIV*/);
}
else {
@@ -12486,10 +12753,10 @@ Tokenizer.prototype.next = function() {
default:
- if (TokenizerHelpers.isIdentifierStart(ch)) {
+ if ($notnull_bool(TokenizerHelpers.isIdentifierStart(ch))) {
return this.finishIdentifier();
}
- else if (TokenizerHelpers.isDigit(ch)) {
+ else if ($notnull_bool(TokenizerHelpers.isDigit(ch))) {
return this.finishNumber();
}
else {
@@ -12503,185 +12770,185 @@ Tokenizer.prototype.getIdentifierKind = function() {
switch (this._lang_index - i0) {
case 2:
- if (this._text.charCodeAt(i0) == 100) {
- if (this._text.charCodeAt(i0 + 1) == 111) return 93/*TokenKind.DO*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 100)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 111)) return 94/*TokenKind.DO*/;
}
- else if (this._text.charCodeAt(i0) == 105) {
- if (this._text.charCodeAt(i0 + 1) == 102) {
- return 99/*TokenKind.IF*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 105)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 102)) {
+ return 100/*TokenKind.IF*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 110) {
- return 100/*TokenKind.IN*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 110)) {
+ return 101/*TokenKind.IN*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 115) {
- return 101/*TokenKind.IS*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 115)) {
+ return 102/*TokenKind.IS*/;
}
}
- return 69/*TokenKind.IDENTIFIER*/;
+ return 70/*TokenKind.IDENTIFIER*/;
case 3:
- if (this._text.charCodeAt(i0) == 102) {
- if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2) == 114) return 98/*TokenKind.FOR*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 102)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2) == 114)) return 99/*TokenKind.FOR*/;
}
- else if (this._text.charCodeAt(i0) == 103) {
- if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 116) return 75/*TokenKind.GET*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 103)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 116)) return 76/*TokenKind.GET*/;
}
- else if (this._text.charCodeAt(i0) == 110) {
- if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 119) return 102/*TokenKind.NEW*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 110)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 119)) return 103/*TokenKind.NEW*/;
}
- else if (this._text.charCodeAt(i0) == 115) {
- if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 116) return 83/*TokenKind.SET*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 115)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 116)) return 84/*TokenKind.SET*/;
}
- else if (this._text.charCodeAt(i0) == 116) {
- if (this._text.charCodeAt(i0 + 1) == 114 && this._text.charCodeAt(i0 + 2) == 121) return 110/*TokenKind.TRY*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 116)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 114 && this._text.charCodeAt(i0 + 2) == 121)) return 111/*TokenKind.TRY*/;
}
- else if (this._text.charCodeAt(i0) == 118) {
- if (this._text.charCodeAt(i0 + 1) == 97 && this._text.charCodeAt(i0 + 2) == 114) return 111/*TokenKind.VAR*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 118)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 97 && this._text.charCodeAt(i0 + 2) == 114)) return 112/*TokenKind.VAR*/;
}
- return 69/*TokenKind.IDENTIFIER*/;
+ return 70/*TokenKind.IDENTIFIER*/;
case 4:
- if (this._text.charCodeAt(i0) == 99) {
- if (this._text.charCodeAt(i0 + 1) == 97 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 101) return 88/*TokenKind.CASE*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 99)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 97 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 101)) return 89/*TokenKind.CASE*/;
}
- else if (this._text.charCodeAt(i0) == 101) {
- if (this._text.charCodeAt(i0 + 1) == 108 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 101) return 94/*TokenKind.ELSE*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 101)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 108 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 101)) return 95/*TokenKind.ELSE*/;
}
- else if (this._text.charCodeAt(i0) == 110) {
- if (this._text.charCodeAt(i0 + 1) == 117 && this._text.charCodeAt(i0 + 2) == 108 && this._text.charCodeAt(i0 + 3) == 108) return 103/*TokenKind.NULL*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 110)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 117 && this._text.charCodeAt(i0 + 2) == 108 && this._text.charCodeAt(i0 + 3) == 108)) return 104/*TokenKind.NULL*/;
}
- else if (this._text.charCodeAt(i0) == 116) {
- if (this._text.charCodeAt(i0 + 1) == 104) {
- if (this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 115) return 107/*TokenKind.THIS*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 116)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 104)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 115)) return 108/*TokenKind.THIS*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 114) {
- if (this._text.charCodeAt(i0 + 2) == 117 && this._text.charCodeAt(i0 + 3) == 101) return 109/*TokenKind.TRUE*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 114)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 117 && this._text.charCodeAt(i0 + 3) == 101)) return 110/*TokenKind.TRUE*/;
}
}
- else if (this._text.charCodeAt(i0) == 118) {
- if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 100) return 112/*TokenKind.VOID*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 118)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 100)) return 113/*TokenKind.VOID*/;
}
- return 69/*TokenKind.IDENTIFIER*/;
+ return 70/*TokenKind.IDENTIFIER*/;
case 5:
- if (this._text.charCodeAt(i0) == 98) {
- if (this._text.charCodeAt(i0 + 1) == 114 && this._text.charCodeAt(i0 + 2) == 101 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 107) return 87/*TokenKind.BREAK*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 98)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 114 && this._text.charCodeAt(i0 + 2) == 101 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 107)) return 88/*TokenKind.BREAK*/;
}
- else if (this._text.charCodeAt(i0) == 99) {
- if (this._text.charCodeAt(i0 + 1) == 97) {
- if (this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 99 && this._text.charCodeAt(i0 + 4) == 104) return 89/*TokenKind.CATCH*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 99)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 97)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 99 && this._text.charCodeAt(i0 + 4) == 104)) return 90/*TokenKind.CATCH*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 108) {
- if (this._text.charCodeAt(i0 + 2) == 97 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 115) return 72/*TokenKind.CLASS*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 108)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 97 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 115)) return 73/*TokenKind.CLASS*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 111) {
- if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 116) return 90/*TokenKind.CONST*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 111)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 116)) return 91/*TokenKind.CONST*/;
}
}
- else if (this._text.charCodeAt(i0) == 102) {
- if (this._text.charCodeAt(i0 + 1) == 97) {
- if (this._text.charCodeAt(i0 + 2) == 108 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 101) return 95/*TokenKind.FALSE*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 102)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 97)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 108 && this._text.charCodeAt(i0 + 3) == 115 && this._text.charCodeAt(i0 + 4) == 101)) return 96/*TokenKind.FALSE*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 105) {
- if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 108) return 96/*TokenKind.FINAL*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 105)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 108)) return 97/*TokenKind.FINAL*/;
}
}
- else if (this._text.charCodeAt(i0) == 115) {
- if (this._text.charCodeAt(i0 + 1) == 117 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 114) return 105/*TokenKind.SUPER*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 115)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 117 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 114)) return 106/*TokenKind.SUPER*/;
}
- else if (this._text.charCodeAt(i0) == 116) {
- if (this._text.charCodeAt(i0 + 1) == 104 && this._text.charCodeAt(i0 + 2) == 114 && this._text.charCodeAt(i0 + 3) == 111 && this._text.charCodeAt(i0 + 4) == 119) return 108/*TokenKind.THROW*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 116)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 104 && this._text.charCodeAt(i0 + 2) == 114 && this._text.charCodeAt(i0 + 3) == 111 && this._text.charCodeAt(i0 + 4) == 119)) return 109/*TokenKind.THROW*/;
}
- else if (this._text.charCodeAt(i0) == 119) {
- if (this._text.charCodeAt(i0 + 1) == 104 && this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 108 && this._text.charCodeAt(i0 + 4) == 101) return 113/*TokenKind.WHILE*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 119)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 104 && this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 108 && this._text.charCodeAt(i0 + 4) == 101)) return 114/*TokenKind.WHILE*/;
}
- return 69/*TokenKind.IDENTIFIER*/;
+ return 70/*TokenKind.IDENTIFIER*/;
case 6:
- if (this._text.charCodeAt(i0) == 97) {
- if (this._text.charCodeAt(i0 + 1) == 115 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 116) return 71/*TokenKind.ASSERT*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 97)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 115 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 116)) return 72/*TokenKind.ASSERT*/;
}
- else if (this._text.charCodeAt(i0) == 105) {
- if (this._text.charCodeAt(i0 + 1) == 109 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 111 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 116) return 77/*TokenKind.IMPORT*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 105)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 109 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 111 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 116)) return 78/*TokenKind.IMPORT*/;
}
- else if (this._text.charCodeAt(i0) == 110) {
- if (this._text.charCodeAt(i0 + 1) == 97) {
- if (this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 105 && this._text.charCodeAt(i0 + 4) == 118 && this._text.charCodeAt(i0 + 5) == 101) return 80/*TokenKind.NATIVE*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 110)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 97)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 105 && this._text.charCodeAt(i0 + 4) == 118 && this._text.charCodeAt(i0 + 5) == 101)) return 81/*TokenKind.NATIVE*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 101) {
- if (this._text.charCodeAt(i0 + 2) == 103 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 116 && this._text.charCodeAt(i0 + 5) == 101) return 81/*TokenKind.NEGATE*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 101)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 103 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 116 && this._text.charCodeAt(i0 + 5) == 101)) return 82/*TokenKind.NEGATE*/;
}
}
- else if (this._text.charCodeAt(i0) == 114) {
- if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 117 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 110) return 104/*TokenKind.RETURN*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 114)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 117 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 110)) return 105/*TokenKind.RETURN*/;
}
- else if (this._text.charCodeAt(i0) == 115) {
- if (this._text.charCodeAt(i0 + 1) == 111) {
- if (this._text.charCodeAt(i0 + 2) == 117 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 99 && this._text.charCodeAt(i0 + 5) == 101) return 84/*TokenKind.SOURCE*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 115)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 111)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 117 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 99 && this._text.charCodeAt(i0 + 5) == 101)) return 85/*TokenKind.SOURCE*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 116) {
- if (this._text.charCodeAt(i0 + 2) == 97 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 105 && this._text.charCodeAt(i0 + 5) == 99) return 85/*TokenKind.STATIC*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 116)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 97 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 105 && this._text.charCodeAt(i0 + 5) == 99)) return 86/*TokenKind.STATIC*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 119) {
- if (this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 99 && this._text.charCodeAt(i0 + 5) == 104) return 106/*TokenKind.SWITCH*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 119)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 105 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 99 && this._text.charCodeAt(i0 + 5) == 104)) return 107/*TokenKind.SWITCH*/;
}
}
- return 69/*TokenKind.IDENTIFIER*/;
+ return 70/*TokenKind.IDENTIFIER*/;
case 7:
- if (this._text.charCodeAt(i0) == 100) {
- if (this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 102 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 117 && this._text.charCodeAt(i0 + 5) == 108 && this._text.charCodeAt(i0 + 6) == 116) return 92/*TokenKind.DEFAULT*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 100)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 101 && this._text.charCodeAt(i0 + 2) == 102 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 117 && this._text.charCodeAt(i0 + 5) == 108 && this._text.charCodeAt(i0 + 6) == 116)) return 93/*TokenKind.DEFAULT*/;
}
- else if (this._text.charCodeAt(i0) == 101) {
- if (this._text.charCodeAt(i0 + 1) == 120 && this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 110 && this._text.charCodeAt(i0 + 5) == 100 && this._text.charCodeAt(i0 + 6) == 115) return 73/*TokenKind.EXTENDS*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 101)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 120 && this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 110 && this._text.charCodeAt(i0 + 5) == 100 && this._text.charCodeAt(i0 + 6) == 115)) return 74/*TokenKind.EXTENDS*/;
}
- else if (this._text.charCodeAt(i0) == 102) {
- if (this._text.charCodeAt(i0 + 1) == 97) {
- if (this._text.charCodeAt(i0 + 2) == 99 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 111 && this._text.charCodeAt(i0 + 5) == 114 && this._text.charCodeAt(i0 + 6) == 121) return 74/*TokenKind.FACTORY*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 102)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 97)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 99 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 111 && this._text.charCodeAt(i0 + 5) == 114 && this._text.charCodeAt(i0 + 6) == 121)) return 75/*TokenKind.FACTORY*/;
}
- else if (this._text.charCodeAt(i0 + 1) == 105) {
- if (this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 108 && this._text.charCodeAt(i0 + 5) == 108 && this._text.charCodeAt(i0 + 6) == 121) return 97/*TokenKind.FINALLY*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 105)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 97 && this._text.charCodeAt(i0 + 4) == 108 && this._text.charCodeAt(i0 + 5) == 108 && this._text.charCodeAt(i0 + 6) == 121)) return 98/*TokenKind.FINALLY*/;
}
}
- else if (this._text.charCodeAt(i0) == 108) {
- if (this._text.charCodeAt(i0 + 1) == 105 && this._text.charCodeAt(i0 + 2) == 98 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 97 && this._text.charCodeAt(i0 + 5) == 114 && this._text.charCodeAt(i0 + 6) == 121) return 79/*TokenKind.LIBRARY*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 108)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 105 && this._text.charCodeAt(i0 + 2) == 98 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 97 && this._text.charCodeAt(i0 + 5) == 114 && this._text.charCodeAt(i0 + 6) == 121)) return 80/*TokenKind.LIBRARY*/;
}
- else if (this._text.charCodeAt(i0) == 116) {
- if (this._text.charCodeAt(i0 + 1) == 121 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 100 && this._text.charCodeAt(i0 + 5) == 101 && this._text.charCodeAt(i0 + 6) == 102) return 86/*TokenKind.TYPEDEF*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 116)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 121 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 100 && this._text.charCodeAt(i0 + 5) == 101 && this._text.charCodeAt(i0 + 6) == 102)) return 87/*TokenKind.TYPEDEF*/;
}
- return 69/*TokenKind.IDENTIFIER*/;
+ return 70/*TokenKind.IDENTIFIER*/;
case 8:
- if (this._text.charCodeAt(i0) == 97) {
- if (this._text.charCodeAt(i0 + 1) == 98 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 97 && this._text.charCodeAt(i0 + 6) == 99 && this._text.charCodeAt(i0 + 7) == 116) return 70/*TokenKind.ABSTRACT*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 97)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 98 && this._text.charCodeAt(i0 + 2) == 115 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 97 && this._text.charCodeAt(i0 + 6) == 99 && this._text.charCodeAt(i0 + 7) == 116)) return 71/*TokenKind.ABSTRACT*/;
}
- else if (this._text.charCodeAt(i0) == 99) {
- if (this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 105 && this._text.charCodeAt(i0 + 5) == 110 && this._text.charCodeAt(i0 + 6) == 117 && this._text.charCodeAt(i0 + 7) == 101) return 91/*TokenKind.CONTINUE*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 99)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 111 && this._text.charCodeAt(i0 + 2) == 110 && this._text.charCodeAt(i0 + 3) == 116 && this._text.charCodeAt(i0 + 4) == 105 && this._text.charCodeAt(i0 + 5) == 110 && this._text.charCodeAt(i0 + 6) == 117 && this._text.charCodeAt(i0 + 7) == 101)) return 92/*TokenKind.CONTINUE*/;
}
- else if (this._text.charCodeAt(i0) == 111) {
- if (this._text.charCodeAt(i0 + 1) == 112 && this._text.charCodeAt(i0 + 2) == 101 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 97 && this._text.charCodeAt(i0 + 5) == 116 && this._text.charCodeAt(i0 + 6) == 111 && this._text.charCodeAt(i0 + 7) == 114) return 82/*TokenKind.OPERATOR*/;
+ else if ($notnull_bool(this._text.charCodeAt(i0) == 111)) {
+ if ($notnull_bool(this._text.charCodeAt(i0 + 1) == 112 && this._text.charCodeAt(i0 + 2) == 101 && this._text.charCodeAt(i0 + 3) == 114 && this._text.charCodeAt(i0 + 4) == 97 && this._text.charCodeAt(i0 + 5) == 116 && this._text.charCodeAt(i0 + 6) == 111 && this._text.charCodeAt(i0 + 7) == 114)) return 83/*TokenKind.OPERATOR*/;
}
- return 69/*TokenKind.IDENTIFIER*/;
+ return 70/*TokenKind.IDENTIFIER*/;
case 9:
- if (this._text.charCodeAt(i0) == 105 && this._text.charCodeAt(i0 + 1) == 110 && this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 102 && this._text.charCodeAt(i0 + 6) == 97 && this._text.charCodeAt(i0 + 7) == 99 && this._text.charCodeAt(i0 + 8) == 101) return 78/*TokenKind.INTERFACE*/;
- return 69/*TokenKind.IDENTIFIER*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 105 && this._text.charCodeAt(i0 + 1) == 110 && this._text.charCodeAt(i0 + 2) == 116 && this._text.charCodeAt(i0 + 3) == 101 && this._text.charCodeAt(i0 + 4) == 114 && this._text.charCodeAt(i0 + 5) == 102 && this._text.charCodeAt(i0 + 6) == 97 && this._text.charCodeAt(i0 + 7) == 99 && this._text.charCodeAt(i0 + 8) == 101)) return 79/*TokenKind.INTERFACE*/;
+ return 70/*TokenKind.IDENTIFIER*/;
case 10:
- if (this._text.charCodeAt(i0) == 105 && this._text.charCodeAt(i0 + 1) == 109 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 108 && this._text.charCodeAt(i0 + 4) == 101 && this._text.charCodeAt(i0 + 5) == 109 && this._text.charCodeAt(i0 + 6) == 101 && this._text.charCodeAt(i0 + 7) == 110 && this._text.charCodeAt(i0 + 8) == 116 && this._text.charCodeAt(i0 + 9) == 115) return 76/*TokenKind.IMPLEMENTS*/;
- return 69/*TokenKind.IDENTIFIER*/;
+ if ($notnull_bool(this._text.charCodeAt(i0) == 105 && this._text.charCodeAt(i0 + 1) == 109 && this._text.charCodeAt(i0 + 2) == 112 && this._text.charCodeAt(i0 + 3) == 108 && this._text.charCodeAt(i0 + 4) == 101 && this._text.charCodeAt(i0 + 5) == 109 && this._text.charCodeAt(i0 + 6) == 101 && this._text.charCodeAt(i0 + 7) == 110 && this._text.charCodeAt(i0 + 8) == 116 && this._text.charCodeAt(i0 + 9) == 115)) return 77/*TokenKind.IMPLEMENTS*/;
+ return 70/*TokenKind.IDENTIFIER*/;
default:
- return 69/*TokenKind.IDENTIFIER*/;
+ return 70/*TokenKind.IDENTIFIER*/;
}
}
@@ -12942,219 +13209,223 @@ TokenKind.kindToString = function(kind) {
return "string part";
- case 60/*TokenKind.NUMBER*/:
+ case 60/*TokenKind.INTEGER*/:
+
+ return "integer";
- return "number";
+ case 61/*TokenKind.HEX_INTEGER*/:
- case 61/*TokenKind.HEX_NUMBER*/:
+ return "hex integer";
- return "hex number";
+ case 62/*TokenKind.DOUBLE*/:
- case 62/*TokenKind.WHITESPACE*/:
+ return "double";
+
+ case 63/*TokenKind.WHITESPACE*/:
return "whitespace";
- case 63/*TokenKind.COMMENT*/:
+ case 64/*TokenKind.COMMENT*/:
return "comment";
- case 64/*TokenKind.ERROR*/:
+ case 65/*TokenKind.ERROR*/:
return "error";
- case 65/*TokenKind.INCOMPLETE_STRING*/:
+ case 66/*TokenKind.INCOMPLETE_STRING*/:
return "incomplete string";
- case 66/*TokenKind.INCOMPLETE_COMMENT*/:
+ case 67/*TokenKind.INCOMPLETE_COMMENT*/:
return "incomplete comment";
- case 67/*TokenKind.INCOMPLETE_MULTILINE_STRING_DQ*/:
+ case 68/*TokenKind.INCOMPLETE_MULTILINE_STRING_DQ*/:
return "incomplete multiline string dq";
- case 68/*TokenKind.INCOMPLETE_MULTILINE_STRING_SQ*/:
+ case 69/*TokenKind.INCOMPLETE_MULTILINE_STRING_SQ*/:
return "incomplete multiline string sq";
- case 69/*TokenKind.IDENTIFIER*/:
+ case 70/*TokenKind.IDENTIFIER*/:
return "identifier";
- case 70/*TokenKind.ABSTRACT*/:
+ case 71/*TokenKind.ABSTRACT*/:
return "pseudo-keyword 'abstract'";
- case 71/*TokenKind.ASSERT*/:
+ case 72/*TokenKind.ASSERT*/:
return "pseudo-keyword 'assert'";
- case 72/*TokenKind.CLASS*/:
+ case 73/*TokenKind.CLASS*/:
return "pseudo-keyword 'class'";
- case 73/*TokenKind.EXTENDS*/:
+ case 74/*TokenKind.EXTENDS*/:
return "pseudo-keyword 'extends'";
- case 74/*TokenKind.FACTORY*/:
+ case 75/*TokenKind.FACTORY*/:
return "pseudo-keyword 'factory'";
- case 75/*TokenKind.GET*/:
+ case 76/*TokenKind.GET*/:
return "pseudo-keyword 'get'";
- case 76/*TokenKind.IMPLEMENTS*/:
+ case 77/*TokenKind.IMPLEMENTS*/:
return "pseudo-keyword 'implements'";
- case 77/*TokenKind.IMPORT*/:
+ case 78/*TokenKind.IMPORT*/:
return "pseudo-keyword 'import'";
- case 78/*TokenKind.INTERFACE*/:
+ case 79/*TokenKind.INTERFACE*/:
return "pseudo-keyword 'interface'";
- case 79/*TokenKind.LIBRARY*/:
+ case 80/*TokenKind.LIBRARY*/:
return "pseudo-keyword 'library'";
- case 80/*TokenKind.NATIVE*/:
+ case 81/*TokenKind.NATIVE*/:
return "pseudo-keyword 'native'";
- case 81/*TokenKind.NEGATE*/:
+ case 82/*TokenKind.NEGATE*/:
return "pseudo-keyword 'negate'";
- case 82/*TokenKind.OPERATOR*/:
+ case 83/*TokenKind.OPERATOR*/:
return "pseudo-keyword 'operator'";
- case 83/*TokenKind.SET*/:
+ case 84/*TokenKind.SET*/:
return "pseudo-keyword 'set'";
- case 84/*TokenKind.SOURCE*/:
+ case 85/*TokenKind.SOURCE*/:
return "pseudo-keyword 'source'";
- case 85/*TokenKind.STATIC*/:
+ case 86/*TokenKind.STATIC*/:
return "pseudo-keyword 'static'";
- case 86/*TokenKind.TYPEDEF*/:
+ case 87/*TokenKind.TYPEDEF*/:
return "pseudo-keyword 'typedef'";
- case 87/*TokenKind.BREAK*/:
+ case 88/*TokenKind.BREAK*/:
return "keyword 'break'";
- case 88/*TokenKind.CASE*/:
+ case 89/*TokenKind.CASE*/:
return "keyword 'case'";
- case 89/*TokenKind.CATCH*/:
+ case 90/*TokenKind.CATCH*/:
return "keyword 'catch'";
- case 90/*TokenKind.CONST*/:
+ case 91/*TokenKind.CONST*/:
return "keyword 'const'";
- case 91/*TokenKind.CONTINUE*/:
+ case 92/*TokenKind.CONTINUE*/:
return "keyword 'continue'";
- case 92/*TokenKind.DEFAULT*/:
+ case 93/*TokenKind.DEFAULT*/:
return "keyword 'default'";
- case 93/*TokenKind.DO*/:
+ case 94/*TokenKind.DO*/:
return "keyword 'do'";
- case 94/*TokenKind.ELSE*/:
+ case 95/*TokenKind.ELSE*/:
return "keyword 'else'";
- case 95/*TokenKind.FALSE*/:
+ case 96/*TokenKind.FALSE*/:
return "keyword 'false'";
- case 96/*TokenKind.FINAL*/:
+ case 97/*TokenKind.FINAL*/:
return "keyword 'final'";
- case 97/*TokenKind.FINALLY*/:
+ case 98/*TokenKind.FINALLY*/:
return "keyword 'finally'";
- case 98/*TokenKind.FOR*/:
+ case 99/*TokenKind.FOR*/:
return "keyword 'for'";
- case 99/*TokenKind.IF*/:
+ case 100/*TokenKind.IF*/:
return "keyword 'if'";
- case 100/*TokenKind.IN*/:
+ case 101/*TokenKind.IN*/:
return "keyword 'in'";
- case 101/*TokenKind.IS*/:
+ case 102/*TokenKind.IS*/:
return "keyword 'is'";
- case 102/*TokenKind.NEW*/:
+ case 103/*TokenKind.NEW*/:
return "keyword 'new'";
- case 103/*TokenKind.NULL*/:
+ case 104/*TokenKind.NULL*/:
return "keyword 'null'";
- case 104/*TokenKind.RETURN*/:
+ case 105/*TokenKind.RETURN*/:
return "keyword 'return'";
- case 105/*TokenKind.SUPER*/:
+ case 106/*TokenKind.SUPER*/:
return "keyword 'super'";
- case 106/*TokenKind.SWITCH*/:
+ case 107/*TokenKind.SWITCH*/:
return "keyword 'switch'";
- case 107/*TokenKind.THIS*/:
+ case 108/*TokenKind.THIS*/:
return "keyword 'this'";
- case 108/*TokenKind.THROW*/:
+ case 109/*TokenKind.THROW*/:
return "keyword 'throw'";
- case 109/*TokenKind.TRUE*/:
+ case 110/*TokenKind.TRUE*/:
return "keyword 'true'";
- case 110/*TokenKind.TRY*/:
+ case 111/*TokenKind.TRY*/:
return "keyword 'try'";
- case 111/*TokenKind.VAR*/:
+ case 112/*TokenKind.VAR*/:
return "keyword 'var'";
- case 112/*TokenKind.VOID*/:
+ case 113/*TokenKind.VOID*/:
return "keyword 'void'";
- case 113/*TokenKind.WHILE*/:
+ case 114/*TokenKind.WHILE*/:
return "keyword 'while'";
@@ -13165,7 +13436,7 @@ TokenKind.kindToString = function(kind) {
}
}
TokenKind.isIdentifier = function(kind) {
- return kind >= 69/*TokenKind.IDENTIFIER*/ && kind < 87/*TokenKind.BREAK*/;
+ return kind >= 70/*TokenKind.IDENTIFIER*/ && kind < 88/*TokenKind.BREAK*/;
}
TokenKind.infixPrecedence = function(kind) {
switch (kind) {
@@ -13313,7 +13584,7 @@ TokenKind.infixPrecedence = function(kind) {
return 10;
- case 101/*TokenKind.IS*/:
+ case 102/*TokenKind.IS*/:
return 10;
@@ -13496,8 +13767,8 @@ TokenKind.binaryMethodName = function(kind) {
}
}
TokenKind.kindFromAssign = function(kind) {
- if (kind == 20/*TokenKind.ASSIGN*/) return 0;
- if (kind > 20/*TokenKind.ASSIGN*/ && kind <= 32/*TokenKind.ASSIGN_MOD*/) {
+ if ($notnull_bool(kind == 20/*TokenKind.ASSIGN*/)) return 0;
+ if ($notnull_bool(kind > 20/*TokenKind.ASSIGN*/ && kind <= 32/*TokenKind.ASSIGN_MOD*/)) {
return kind + (15)/*(ADD - ASSIGN_ADD)*/;
}
return -1;
@@ -13514,7 +13785,7 @@ function lang_Parser(source, diet, startOffset) {
}
lang_Parser.prototype.get$source = function() { return this.source; };
lang_Parser.prototype.isPrematureEndOfFile = function() {
- if (this._maybeEat(1/*TokenKind.END_OF_FILE*/)) {
+ if ($notnull_bool(this._maybeEat(1/*TokenKind.END_OF_FILE*/))) {
this._lang_error('unexpected end of file', this._peekToken.get$span());
return true;
}
@@ -13537,7 +13808,7 @@ lang_Parser.prototype._peekIdentifier = function() {
return TokenKind.isIdentifier(this._peekToken.kind);
}
lang_Parser.prototype._maybeEat = function(kind) {
- if (this._peekToken.kind == kind) {
+ if ($notnull_bool(this._peekToken.kind == kind)) {
this._previousToken = this._peekToken;
this._peekToken = this.tokenizer.next();
return true;
@@ -13547,7 +13818,7 @@ lang_Parser.prototype._maybeEat = function(kind) {
}
}
lang_Parser.prototype._eat = function(kind) {
- if (!this._maybeEat(kind)) {
+ if ($notnull_bool(!this._maybeEat(kind))) {
this._errorExpected(TokenKind.kindToString(kind));
}
}
@@ -13557,10 +13828,10 @@ lang_Parser.prototype._eatSemicolon = function() {
lang_Parser.prototype._errorExpected = function(expected) {
var tok = this._lang_next();
var message = ('expected ' + expected + ', but found ' + tok + '');
- this._lang_error(message, tok.get$span());
+ this._lang_error($assert_String(message), tok.get$span());
}
lang_Parser.prototype._lang_error = function(message, location) {
- if (location == null) {
+ if ($notnull_bool(location == null)) {
location = this._peekToken.get$span();
}
world.fatal(message, location);
@@ -13568,16 +13839,16 @@ lang_Parser.prototype._lang_error = function(message, location) {
lang_Parser.prototype._skipBlock = function() {
var depth = 1;
this._eat(6/*TokenKind.LBRACE*/);
- while (true) {
+ while ($notnull_bool(true)) {
var tok = this._lang_next();
- if (tok.kind == 6/*TokenKind.LBRACE*/) {
+ if ($notnull_bool(tok.kind == 6/*TokenKind.LBRACE*/)) {
depth += 1;
}
- else if (tok.kind == 7/*TokenKind.RBRACE*/) {
+ else if ($notnull_bool(tok.kind == 7/*TokenKind.RBRACE*/)) {
depth -= 1;
- if (depth == 0) return;
+ if ($notnull_bool(depth == 0)) return;
}
- else if (tok.kind == 1/*TokenKind.END_OF_FILE*/) {
+ else if ($notnull_bool(tok.kind == 1/*TokenKind.END_OF_FILE*/)) {
this._lang_error('unexpected end of file during diet parse', tok.get$span());
return;
}
@@ -13589,10 +13860,10 @@ lang_Parser.prototype._makeSpan = function(start) {
lang_Parser.prototype.compilationUnit = function() {
var ret = [];
this._maybeEat(13/*TokenKind.HASHBANG*/);
- while (this._peekKind(12/*TokenKind.HASH*/)) {
+ while ($notnull_bool(this._peekKind(12/*TokenKind.HASH*/))) {
ret.add(this.directive());
}
- while (!this._maybeEat(1/*TokenKind.END_OF_FILE*/)) {
+ while ($notnull_bool(!this._maybeEat(1/*TokenKind.END_OF_FILE*/))) {
ret.add(this.topLevelDefinition());
}
return ret;
@@ -13607,15 +13878,15 @@ lang_Parser.prototype.directive = function() {
}
lang_Parser.prototype.topLevelDefinition = function() {
switch (this._peek()) {
- case 72/*TokenKind.CLASS*/:
+ case 73/*TokenKind.CLASS*/:
- return this.classDefinition(72/*TokenKind.CLASS*/);
+ return this.classDefinition(73/*TokenKind.CLASS*/);
- case 78/*TokenKind.INTERFACE*/:
+ case 79/*TokenKind.INTERFACE*/:
- return this.classDefinition(78/*TokenKind.INTERFACE*/);
+ return this.classDefinition(79/*TokenKind.INTERFACE*/);
- case 86/*TokenKind.TYPEDEF*/:
+ case 87/*TokenKind.TYPEDEF*/:
return this.functionTypeAlias();
@@ -13630,43 +13901,43 @@ lang_Parser.prototype.classDefinition = function(kind) {
this._eat(kind);
var name = this.identifier();
var typeParams = null;
- if (this._peekKind(52/*TokenKind.LT*/)) {
+ if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
typeParams = this.typeParameters();
}
var _extends = null;
- if (this._maybeEat(73/*TokenKind.EXTENDS*/)) {
+ if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) {
_extends = this.typeList();
}
var _implements = null;
- if (this._maybeEat(76/*TokenKind.IMPLEMENTS*/)) {
+ if ($notnull_bool(this._maybeEat(77/*TokenKind.IMPLEMENTS*/))) {
_implements = this.typeList();
}
var _native = null;
- if (this._maybeEat(80/*TokenKind.NATIVE*/)) {
+ if ($notnull_bool(this._maybeEat(81/*TokenKind.NATIVE*/))) {
_native = this.maybeStringLiteral();
}
var _factory = null;
- if (this._maybeEat(74/*TokenKind.FACTORY*/)) {
+ if ($notnull_bool(this._maybeEat(75/*TokenKind.FACTORY*/))) {
_factory = this.type(0);
}
var body = [];
- if (this._maybeEat(6/*TokenKind.LBRACE*/)) {
- while (!this._maybeEat(7/*TokenKind.RBRACE*/)) {
- if (this.isPrematureEndOfFile()) break;
+ if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) {
+ while ($notnull_bool(!this._maybeEat(7/*TokenKind.RBRACE*/))) {
+ if ($notnull_bool(this.isPrematureEndOfFile())) break;
body.add(this.declaration(true));
}
}
else {
this._errorExpected('block starting with "{" or ";"');
}
- return new TypeDefinition(kind == 72/*TokenKind.CLASS*/, name, typeParams, _extends, _implements, _native, _factory, body, this._makeSpan(start));
+ return new TypeDefinition(kind == 73/*TokenKind.CLASS*/, name, typeParams, _extends, _implements, _native, _factory, body, this._makeSpan(start));
}
lang_Parser.prototype.functionTypeAlias = function() {
var start = this._peekToken.start;
- this._eat(86/*TokenKind.TYPEDEF*/);
+ this._eat(87/*TokenKind.TYPEDEF*/);
var di = this.declaredIdentifier(false);
var typeParams = null;
- if (this._peekKind(52/*TokenKind.LT*/)) {
+ if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
typeParams = this.typeParameters();
}
var formals = this.formalParameterList();
@@ -13680,21 +13951,21 @@ lang_Parser.prototype.initializers = function() {
do {
ret.add(this.expression());
}
- while (this._maybeEat(11/*TokenKind.COMMA*/))
+ while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
this._inInitializers = false;
return ret;
}
lang_Parser.prototype.functionBody = function(inExpression) {
var start = this._peekToken.start;
- if (this._maybeEat(9/*TokenKind.ARROW*/)) {
+ if ($notnull_bool(this._maybeEat(9/*TokenKind.ARROW*/))) {
var expr = this.expression();
- if (!inExpression) {
+ if ($notnull_bool(!inExpression)) {
this._eatSemicolon();
}
return new ReturnStatement(expr, this._makeSpan(start));
}
- else if (this._peekKind(6/*TokenKind.LBRACE*/)) {
- if (this.diet) {
+ else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) {
+ if ($notnull_bool(this.diet)) {
this._skipBlock();
return new DietStatement(this._makeSpan(start));
}
@@ -13702,13 +13973,13 @@ lang_Parser.prototype.functionBody = function(inExpression) {
return this.block();
}
}
- else if (!inExpression) {
- if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) {
+ else if ($notnull_bool(!inExpression)) {
+ if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
return null;
}
- else if (this._maybeEat(80/*TokenKind.NATIVE*/)) {
+ else if ($notnull_bool(this._maybeEat(81/*TokenKind.NATIVE*/))) {
var nativeBody = this.maybeStringLiteral();
- if (this._peekKind(10/*TokenKind.SEMICOLON*/)) {
+ if ($notnull_bool(this._peekKind(10/*TokenKind.SEMICOLON*/))) {
this._eatSemicolon();
return new NativeStatement(nativeBody, this._makeSpan(start));
}
@@ -13722,9 +13993,9 @@ lang_Parser.prototype.functionBody = function(inExpression) {
lang_Parser.prototype.finishField = function(start, modifiers, type0, name, value) {
var names = [name];
var values = [value];
- while (this._maybeEat(11/*TokenKind.COMMA*/)) {
+ while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
names.add(this.identifier());
- if (this._maybeEat(20/*TokenKind.ASSIGN*/)) {
+ if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
values.add(this.expression());
}
else {
@@ -13732,7 +14003,7 @@ lang_Parser.prototype.finishField = function(start, modifiers, type0, name, valu
}
}
this._eatSemicolon();
- return new VariableDefinition(modifiers, type0, names, values, this._makeSpan(start));
+ return new VariableDefinition(modifiers, type0, names, values, this._makeSpan($assert_num(start)));
}
lang_Parser.prototype.finishDefinition = function(start, modifiers, di) {
switch (this._peek()) {
@@ -13740,14 +14011,14 @@ lang_Parser.prototype.finishDefinition = function(start, modifiers, di) {
var formals = this.formalParameterList();
var inits = null;
- if (this._maybeEat(8/*TokenKind.COLON*/)) {
+ if ($notnull_bool(this._maybeEat(8/*TokenKind.COLON*/))) {
inits = this.initializers();
}
var body = this.functionBody(false);
- if (di.get$name() == null) {
+ if ($notnull_bool(di.get$name() == null)) {
di.name = di.type.get$name();
}
- return new FunctionDefinition(modifiers, di.type, di.get$name(), formals, inits, body, this._makeSpan(start));
+ return new FunctionDefinition(modifiers, di.type, di.get$name(), formals, inits, body, this._makeSpan($assert_num(start)));
case 20/*TokenKind.ASSIGN*/:
@@ -13769,7 +14040,7 @@ lang_Parser.prototype.finishDefinition = function(start, modifiers, di) {
}
lang_Parser.prototype.declaration = function(includeOperators) {
var start = this._peekToken.start;
- if (this._peekKind(74/*TokenKind.FACTORY*/)) {
+ if ($notnull_bool(this._peekKind(75/*TokenKind.FACTORY*/))) {
return this.factoryConstructorDeclaration();
}
var modifiers = this._readModifiers();
@@ -13779,20 +14050,20 @@ lang_Parser.prototype.factoryConstructorDeclaration = function() {
var start = this._peekToken.start;
var factoryToken = this._lang_next();
var names = [this.identifier()];
- while (this._maybeEat(14/*TokenKind.DOT*/)) {
+ while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
names.add(this.identifier());
}
var typeParams = null;
- if (this._peekKind(52/*TokenKind.LT*/)) {
+ if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
typeParams = this.typeParameters();
}
var name = null;
var type0 = null;
- if (this._maybeEat(14/*TokenKind.DOT*/)) {
+ if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
name = this.identifier();
}
- else if (typeParams == null) {
- if (names.length > 1) {
+ else if ($notnull_bool(typeParams == null)) {
+ if ($notnull_bool(names.length > 1)) {
name = names.removeLast();
}
else {
@@ -13802,7 +14073,7 @@ lang_Parser.prototype.factoryConstructorDeclaration = function() {
else {
name = new lang_Identifier('', names.$index(0).get$span());
}
- if (names.length > 1) {
+ if ($notnull_bool(names.length > 1)) {
this._lang_error('unsupported qualified name for factory', names.$index(0).get$span());
}
type0 = new NameTypeReference(false, names.$index(0), null, names.$index(0).get$span());
@@ -13811,47 +14082,47 @@ lang_Parser.prototype.factoryConstructorDeclaration = function() {
}
lang_Parser.prototype.statement = function() {
switch (this._peek()) {
- case 87/*TokenKind.BREAK*/:
+ case 88/*TokenKind.BREAK*/:
return this.breakStatement();
- case 91/*TokenKind.CONTINUE*/:
+ case 92/*TokenKind.CONTINUE*/:
return this.continueStatement();
- case 104/*TokenKind.RETURN*/:
+ case 105/*TokenKind.RETURN*/:
return this.returnStatement();
- case 108/*TokenKind.THROW*/:
+ case 109/*TokenKind.THROW*/:
return this.throwStatement();
- case 71/*TokenKind.ASSERT*/:
+ case 72/*TokenKind.ASSERT*/:
return this.assertStatement();
- case 113/*TokenKind.WHILE*/:
+ case 114/*TokenKind.WHILE*/:
return this.whileStatement();
- case 93/*TokenKind.DO*/:
+ case 94/*TokenKind.DO*/:
return this.doStatement();
- case 98/*TokenKind.FOR*/:
+ case 99/*TokenKind.FOR*/:
return this.forStatement();
- case 99/*TokenKind.IF*/:
+ case 100/*TokenKind.IF*/:
return this.ifStatement();
- case 106/*TokenKind.SWITCH*/:
+ case 107/*TokenKind.SWITCH*/:
return this.switchStatement();
- case 110/*TokenKind.TRY*/:
+ case 111/*TokenKind.TRY*/:
return this.tryStatement();
@@ -13863,11 +14134,11 @@ lang_Parser.prototype.statement = function() {
return this.emptyStatement();
- case 96/*TokenKind.FINAL*/:
+ case 97/*TokenKind.FINAL*/:
return this.declaration(false);
- case 111/*TokenKind.VAR*/:
+ case 112/*TokenKind.VAR*/:
return this.declaration(false);
@@ -13879,35 +14150,35 @@ lang_Parser.prototype.statement = function() {
}
lang_Parser.prototype.finishExpressionAsStatement = function(expr) {
var start = expr.get$span().start;
- if (this._maybeEat(8/*TokenKind.COLON*/)) {
+ 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 ($notnull_bool((expr instanceof LambdaExpression))) {
+ if ($notnull_bool(!(expr.func.body instanceof BlockStatement))) {
this._eatSemicolon();
expr.func.span = this._makeSpan(start);
}
return expr.func;
}
- else if ((expr instanceof DeclaredIdentifier)) {
+ else if ($notnull_bool((expr instanceof DeclaredIdentifier))) {
var value = null;
- if (this._maybeEat(20/*TokenKind.ASSIGN*/)) {
+ if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
value = this.expression();
}
return this.finishField(start, null, expr.type, expr.get$name(), value);
}
- else if (this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.x instanceof DeclaredIdentifier))) {
+ else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.x instanceof DeclaredIdentifier)))) {
var di = expr.x;
return this.finishField(start, null, di.type, di.name, expr.y);
}
- else if (this._isBin(expr, 52/*TokenKind.LT*/) && this._maybeEat(11/*TokenKind.COMMA*/)) {
+ 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 gt = this._finishTypeArguments(baseType, 0, typeArgs);
+ var gt = this._finishTypeArguments((baseType && baseType.is$TypeReference()), 0, typeArgs);
var name = this.identifier();
var value = null;
- if (this._maybeEat(20/*TokenKind.ASSIGN*/)) {
+ if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
value = this.expression();
}
return this.finishField(expr.get$span().start, null, gt, name, value);
@@ -13927,8 +14198,8 @@ lang_Parser.prototype.block = function() {
var start = this._peekToken.start;
this._eat(6/*TokenKind.LBRACE*/);
var stmts = [];
- while (!this._maybeEat(7/*TokenKind.RBRACE*/)) {
- if (this.isPrematureEndOfFile()) break;
+ while ($notnull_bool(!this._maybeEat(7/*TokenKind.RBRACE*/))) {
+ if ($notnull_bool(this.isPrematureEndOfFile())) break;
stmts.add(this.statement());
}
return new BlockStatement(stmts, this._makeSpan(start));
@@ -13940,48 +14211,48 @@ lang_Parser.prototype.emptyStatement = function() {
}
lang_Parser.prototype.ifStatement = function() {
var start = this._peekToken.start;
- this._eat(99/*TokenKind.IF*/);
+ this._eat(100/*TokenKind.IF*/);
var test = this.testCondition();
var trueBranch = this.statement();
var falseBranch = null;
- if (this._maybeEat(94/*TokenKind.ELSE*/)) {
+ if ($notnull_bool(this._maybeEat(95/*TokenKind.ELSE*/))) {
falseBranch = this.statement();
}
return new IfStatement(test, trueBranch, falseBranch, this._makeSpan(start));
}
lang_Parser.prototype.whileStatement = function() {
var start = this._peekToken.start;
- this._eat(113/*TokenKind.WHILE*/);
+ this._eat(114/*TokenKind.WHILE*/);
var test = this.testCondition();
var body = this.statement();
return new WhileStatement(test, body, this._makeSpan(start));
}
lang_Parser.prototype.doStatement = function() {
var start = this._peekToken.start;
- this._eat(93/*TokenKind.DO*/);
+ this._eat(94/*TokenKind.DO*/);
var body = this.statement();
- this._eat(113/*TokenKind.WHILE*/);
+ this._eat(114/*TokenKind.WHILE*/);
var test = this.testCondition();
this._eatSemicolon();
return new DoStatement(body, test, this._makeSpan(start));
}
lang_Parser.prototype.forStatement = function() {
var start = this._peekToken.start;
- this._eat(98/*TokenKind.FOR*/);
+ this._eat(99/*TokenKind.FOR*/);
this._eat(2/*TokenKind.LPAREN*/);
var init = this.forInitializerStatement(start);
- if ((init instanceof ForInStatement)) {
+ if ($notnull_bool((init instanceof ForInStatement))) {
return init;
}
var test = null;
- if (!this._maybeEat(10/*TokenKind.SEMICOLON*/)) {
+ if ($notnull_bool(!this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
test = this.expression();
this._eatSemicolon();
}
var step = [];
- if (!this._maybeEat(3/*TokenKind.RPAREN*/)) {
+ if ($notnull_bool(!this._maybeEat(3/*TokenKind.RPAREN*/))) {
step.add(this.expression());
- while (this._maybeEat(11/*TokenKind.COMMA*/)) {
+ while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
step.add(this.expression());
}
this._eat(3/*TokenKind.RPAREN*/);
@@ -13990,21 +14261,22 @@ lang_Parser.prototype.forStatement = function() {
return new ForStatement(init, test, step, body, this._makeSpan(start));
}
lang_Parser.prototype.forInitializerStatement = function(start) {
- if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) {
+ var $0;
+ if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
return null;
}
else {
var init = this.expression();
- if (this._peekKind(11/*TokenKind.COMMA*/) && this._isBin(init, 52/*TokenKind.LT*/)) {
+ 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 gt = this._finishTypeArguments(baseType, 0, typeArgs);
+ 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));
}
- if (this._maybeEat(100/*TokenKind.IN*/)) {
- return this._finishForIn(start, this._makeDeclaredIdentifier(init));
+ if ($notnull_bool(this._maybeEat(101/*TokenKind.IN*/))) {
+ return this._finishForIn(start, (($0 = this._makeDeclaredIdentifier(init)) && $0.is$DeclaredIdentifier()));
}
else {
return this.finishExpressionAsStatement(init);
@@ -14019,25 +14291,25 @@ lang_Parser.prototype._finishForIn = function(start, di) {
}
lang_Parser.prototype.tryStatement = function() {
var start = this._peekToken.start;
- this._eat(110/*TokenKind.TRY*/);
+ this._eat(111/*TokenKind.TRY*/);
var body = this.block();
var catches = [];
- while (this._peekKind(89/*TokenKind.CATCH*/)) {
+ while ($notnull_bool(this._peekKind(90/*TokenKind.CATCH*/))) {
catches.add(this.catchNode());
}
var finallyBlock = null;
- if (this._maybeEat(97/*TokenKind.FINALLY*/)) {
+ if ($notnull_bool(this._maybeEat(98/*TokenKind.FINALLY*/))) {
finallyBlock = this.block();
}
return new TryStatement(body, catches, finallyBlock, this._makeSpan(start));
}
lang_Parser.prototype.catchNode = function() {
var start = this._peekToken.start;
- this._eat(89/*TokenKind.CATCH*/);
+ this._eat(90/*TokenKind.CATCH*/);
this._eat(2/*TokenKind.LPAREN*/);
var exc = this.declaredIdentifier(false);
var trace = null;
- if (this._maybeEat(11/*TokenKind.COMMA*/)) {
+ if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
trace = this.declaredIdentifier(false);
}
this._eat(3/*TokenKind.RPAREN*/);
@@ -14046,33 +14318,33 @@ lang_Parser.prototype.catchNode = function() {
}
lang_Parser.prototype.switchStatement = function() {
var start = this._peekToken.start;
- this._eat(106/*TokenKind.SWITCH*/);
+ this._eat(107/*TokenKind.SWITCH*/);
var test = this.testCondition();
var cases = [];
this._eat(6/*TokenKind.LBRACE*/);
- while (!this._maybeEat(7/*TokenKind.RBRACE*/)) {
+ while ($notnull_bool(!this._maybeEat(7/*TokenKind.RBRACE*/))) {
cases.add(this.caseNode());
}
return new SwitchStatement(test, cases, this._makeSpan(start));
}
lang_Parser.prototype._peekCaseEnd = function() {
var kind = this._peek();
- return $eq(kind, 7/*TokenKind.RBRACE*/) || $eq(kind, 88/*TokenKind.CASE*/) || $eq(kind, 92/*TokenKind.DEFAULT*/);
+ return $eq(kind, 7/*TokenKind.RBRACE*/) || $eq(kind, 89/*TokenKind.CASE*/) || $eq(kind, 93/*TokenKind.DEFAULT*/);
}
lang_Parser.prototype.caseNode = function() {
var start = this._peekToken.start;
var label = null;
- if (this._peekIdentifier()) {
+ if ($notnull_bool(this._peekIdentifier())) {
label = this.identifier();
this._eat(8/*TokenKind.COLON*/);
}
var cases = [];
- while (true) {
- if (this._maybeEat(88/*TokenKind.CASE*/)) {
+ while ($notnull_bool(true)) {
+ if ($notnull_bool(this._maybeEat(89/*TokenKind.CASE*/))) {
cases.add(this.expression());
this._eat(8/*TokenKind.COLON*/);
}
- else if (this._maybeEat(92/*TokenKind.DEFAULT*/)) {
+ else if ($notnull_bool(this._maybeEat(93/*TokenKind.DEFAULT*/))) {
cases.add(null);
this._eat(8/*TokenKind.COLON*/);
}
@@ -14080,21 +14352,21 @@ lang_Parser.prototype.caseNode = function() {
break;
}
}
- if (cases.length == 0) {
+ if ($notnull_bool(cases.length == 0)) {
this._lang_error('case or default');
}
var stmts = [];
- while (!this._peekCaseEnd()) {
- if (this.isPrematureEndOfFile()) break;
+ while ($notnull_bool(!this._peekCaseEnd())) {
+ if ($notnull_bool(this.isPrematureEndOfFile())) break;
stmts.add(this.statement());
}
return new CaseNode(label, cases, stmts, this._makeSpan(start));
}
lang_Parser.prototype.returnStatement = function() {
var start = this._peekToken.start;
- this._eat(104/*TokenKind.RETURN*/);
+ this._eat(105/*TokenKind.RETURN*/);
var expr;
- if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) {
+ if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
expr = null;
}
else {
@@ -14105,9 +14377,9 @@ lang_Parser.prototype.returnStatement = function() {
}
lang_Parser.prototype.throwStatement = function() {
var start = this._peekToken.start;
- this._eat(108/*TokenKind.THROW*/);
+ this._eat(109/*TokenKind.THROW*/);
var expr;
- if (this._maybeEat(10/*TokenKind.SEMICOLON*/)) {
+ if ($notnull_bool(this._maybeEat(10/*TokenKind.SEMICOLON*/))) {
expr = null;
}
else {
@@ -14118,7 +14390,7 @@ lang_Parser.prototype.throwStatement = function() {
}
lang_Parser.prototype.assertStatement = function() {
var start = this._peekToken.start;
- this._eat(71/*TokenKind.ASSERT*/);
+ this._eat(72/*TokenKind.ASSERT*/);
this._eat(2/*TokenKind.LPAREN*/);
var expr = this.expression();
this._eat(3/*TokenKind.RPAREN*/);
@@ -14127,9 +14399,9 @@ lang_Parser.prototype.assertStatement = function() {
}
lang_Parser.prototype.breakStatement = function() {
var start = this._peekToken.start;
- this._eat(87/*TokenKind.BREAK*/);
+ this._eat(88/*TokenKind.BREAK*/);
var name = null;
- if (this._peekIdentifier()) {
+ if ($notnull_bool(this._peekIdentifier())) {
name = this.identifier();
}
this._eatSemicolon();
@@ -14137,9 +14409,9 @@ lang_Parser.prototype.breakStatement = function() {
}
lang_Parser.prototype.continueStatement = function() {
var start = this._peekToken.start;
- this._eat(91/*TokenKind.CONTINUE*/);
+ this._eat(92/*TokenKind.CONTINUE*/);
var name = null;
- if (this._peekIdentifier()) {
+ if ($notnull_bool(this._peekIdentifier())) {
name = this.identifier();
}
this._eatSemicolon();
@@ -14149,12 +14421,12 @@ lang_Parser.prototype.expression = function() {
return this.infixExpression(0);
}
lang_Parser.prototype._makeType = function(expr) {
- if ((expr instanceof VarExpression)) {
+ if ($notnull_bool((expr instanceof VarExpression))) {
return new NameTypeReference(false, expr.get$name(), null, expr.get$span());
}
- else if ((expr instanceof DotExpression)) {
+ else if ($notnull_bool((expr instanceof DotExpression))) {
var type0 = this._makeType(expr.self);
- if (type0.names == null) {
+ if ($notnull_bool(type0.names == null)) {
type0.names = [expr.get$name()];
}
else {
@@ -14169,29 +14441,32 @@ lang_Parser.prototype._makeType = function(expr) {
}
}
lang_Parser.prototype.infixExpression = function(precedence) {
- return this.finishInfixExpression(this.unaryExpression(), precedence);
+ var $0;
+ return this.finishInfixExpression((($0 = this.unaryExpression()) && $0.is$lang_Expression()), precedence);
}
lang_Parser.prototype._finishDeclaredId = function(type0) {
var name = this.identifier();
return this.finishPostfixExpression(new DeclaredIdentifier(type0, name, this._makeSpan(type0.get$span().start)));
}
lang_Parser.prototype._fixAsType = function(x) {
- if (this._maybeEat(53/*TokenKind.GT*/)) {
+ $assert(this._isBin(x, 52/*TokenKind.LT*/), "_isBin(x, TokenKind.LT)", "parser.dart", 771, 12);
+ if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) {
var base = this._makeType(x.x);
var typeParam = this._makeType(x.y);
var type0 = new GenericTypeReference(base, [typeParam], 0, this._makeSpan(x.span.start));
return this._finishDeclaredId(type0);
}
else {
+ $assert(this._peekKind(52/*TokenKind.LT*/), "_peekKind(TokenKind.LT)", "parser.dart", 782, 14);
var base = this._makeType(x.x);
var paramBase = this._makeType(x.y);
- var firstParam = this.addTypeArguments(paramBase, 1);
+ var firstParam = this.addTypeArguments((paramBase && paramBase.is$TypeReference()), 1);
var type0;
- if (firstParam.depth <= 0) {
+ if ($notnull_bool(firstParam.depth <= 0)) {
type0 = new GenericTypeReference(base, [firstParam], 0, this._makeSpan(x.span.start));
}
- else if (this._maybeEat(11/*TokenKind.COMMA*/)) {
- type0 = this._finishTypeArguments(base, 0, [firstParam]);
+ else if ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
+ type0 = this._finishTypeArguments((base && base.is$TypeReference()), 0, [firstParam]);
}
else {
this._eat(53/*TokenKind.GT*/);
@@ -14201,26 +14476,26 @@ lang_Parser.prototype._fixAsType = function(x) {
}
}
lang_Parser.prototype.finishInfixExpression = function(x, precedence) {
- while (true) {
+ while ($notnull_bool(true)) {
var kind = this._peek();
var prec = TokenKind.infixPrecedence(this._peek());
- if (prec >= precedence) {
- if (kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/) {
- if (this._isBin(x, 52/*TokenKind.LT*/)) {
- return this._fixAsType(x);
+ if ($notnull_bool(prec >= precedence)) {
+ if ($notnull_bool(kind == 52/*TokenKind.LT*/ || kind == 53/*TokenKind.GT*/)) {
+ if ($notnull_bool(this._isBin(x, 52/*TokenKind.LT*/))) {
+ return this._fixAsType((x && x.is$BinaryExpression()));
}
}
var op = this._lang_next();
- if (op.kind == 101/*TokenKind.IS*/) {
+ if ($notnull_bool(op.kind == 102/*TokenKind.IS*/)) {
var isTrue = !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($eq(prec, 2) ? prec : prec + 1);
- if (op.kind == 33/*TokenKind.CONDITIONAL*/) {
+ var y = this.infixExpression($assert_num($notnull_bool($eq(prec, 2)) ? prec : prec + 1));
+ if ($notnull_bool(op.kind == 33/*TokenKind.CONDITIONAL*/)) {
this._eat(8/*TokenKind.COLON*/);
- var z = this.infixExpression(prec + 1);
+ var z = this.infixExpression($assert_num(prec + 1));
x = new ConditionalExpression(x, y, z, this._makeSpan(x.span.start));
}
else {
@@ -14252,7 +14527,7 @@ lang_Parser.prototype._isPrefixUnaryOperator = function(kind) {
}
lang_Parser.prototype.unaryExpression = function() {
var start = this._peekToken.start;
- if (this._isPrefixUnaryOperator(this._peek())) {
+ if ($notnull_bool(this._isPrefixUnaryOperator(this._peek()))) {
var tok = this._lang_next();
var expr = this.unaryExpression();
return new UnaryExpression(tok, expr, this._makeSpan(start));
@@ -14263,11 +14538,11 @@ lang_Parser.prototype.argument = function() {
var start = this._peekToken.start;
var expr;
var label = null;
- if (this._maybeEat(15/*TokenKind.ELLIPSIS*/)) {
+ if ($notnull_bool(this._maybeEat(15/*TokenKind.ELLIPSIS*/))) {
label = new lang_Identifier('...', this._makeSpan(start));
}
expr = this.expression();
- if (label == null && this._maybeEat(8/*TokenKind.COLON*/)) {
+ if ($notnull_bool(label == null && this._maybeEat(8/*TokenKind.COLON*/))) {
label = this._makeLabel(expr);
expr = this.expression();
}
@@ -14276,11 +14551,11 @@ lang_Parser.prototype.argument = function() {
lang_Parser.prototype.arguments = function() {
var args = [];
this._eat(2/*TokenKind.LPAREN*/);
- if (!this._maybeEat(3/*TokenKind.RPAREN*/)) {
+ if ($notnull_bool(!this._maybeEat(3/*TokenKind.RPAREN*/))) {
do {
args.add(this.argument());
}
- while (this._maybeEat(11/*TokenKind.COMMA*/))
+ while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
this._eat(3/*TokenKind.RPAREN*/);
}
return args;
@@ -14317,13 +14592,13 @@ lang_Parser.prototype.finishPostfixExpression = function(expr) {
case 9/*TokenKind.ARROW*/:
case 6/*TokenKind.LBRACE*/:
- if (this._inInitializers) return expr;
+ if ($notnull_bool(this._inInitializers)) return expr;
var body = this.functionBody(true);
return this._makeFunction(expr, body);
default:
- if (this._peekIdentifier()) {
+ if ($notnull_bool(this._peekIdentifier())) {
return this.finishPostfixExpression(new DeclaredIdentifier(this._makeType(expr), this.identifier(), this._makeSpan(expr.get$span().start)));
}
else {
@@ -14338,8 +14613,11 @@ lang_Parser.prototype._isBin = function(expr, kind) {
lang_Parser.prototype._boolTypeRef = function(span) {
return new TypeReference(span, world.boolType);
}
-lang_Parser.prototype._numTypeRef = function(span) {
- return new TypeReference(span, world.numType);
+lang_Parser.prototype._intTypeRef = function(span) {
+ return new TypeReference(span, world.intType);
+}
+lang_Parser.prototype._doubleTypeRef = function(span) {
+ return new TypeReference(span, world.doubleType);
}
lang_Parser.prototype._stringTypeRef = function(span) {
return new TypeReference(span, world.stringType);
@@ -14347,35 +14625,35 @@ lang_Parser.prototype._stringTypeRef = function(span) {
lang_Parser.prototype.primary = function() {
var start = this._peekToken.start;
switch (this._peek()) {
- case 107/*TokenKind.THIS*/:
+ case 108/*TokenKind.THIS*/:
- this._eat(107/*TokenKind.THIS*/);
+ this._eat(108/*TokenKind.THIS*/);
return new ThisExpression(this._makeSpan(start));
- case 105/*TokenKind.SUPER*/:
+ case 106/*TokenKind.SUPER*/:
- this._eat(105/*TokenKind.SUPER*/);
+ this._eat(106/*TokenKind.SUPER*/);
return new SuperExpression(this._makeSpan(start));
- case 90/*TokenKind.CONST*/:
+ case 91/*TokenKind.CONST*/:
- this._eat(90/*TokenKind.CONST*/);
- if (this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind.INDEX*/)) {
+ this._eat(91/*TokenKind.CONST*/);
+ if ($notnull_bool(this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind.INDEX*/))) {
return this.finishListLiteral(start, true, null);
}
- else if (this._peekKind(6/*TokenKind.LBRACE*/)) {
+ else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) {
return this.finishMapLiteral(start, true, null);
}
- else if (this._peekKind(52/*TokenKind.LT*/)) {
+ else if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
return this.finishTypedLiteral(start, true);
}
else {
return this.finishNewExpression(start, true);
}
- case 102/*TokenKind.NEW*/:
+ case 103/*TokenKind.NEW*/:
- this._eat(102/*TokenKind.NEW*/);
+ this._eat(103/*TokenKind.NEW*/);
return this.finishNewExpression(start, false);
case 2/*TokenKind.LPAREN*/:
@@ -14391,36 +14669,41 @@ lang_Parser.prototype.primary = function() {
return this.finishMapLiteral(start, false, null);
- case 103/*TokenKind.NULL*/:
+ case 104/*TokenKind.NULL*/:
- this._eat(103/*TokenKind.NULL*/);
+ this._eat(104/*TokenKind.NULL*/);
return new NullExpression(this._makeSpan(start));
- case 109/*TokenKind.TRUE*/:
+ case 110/*TokenKind.TRUE*/:
- this._eat(109/*TokenKind.TRUE*/);
+ this._eat(110/*TokenKind.TRUE*/);
return new LiteralExpression(true, this._boolTypeRef(this._makeSpan(start)), 'true', this._makeSpan(start));
- case 95/*TokenKind.FALSE*/:
+ case 96/*TokenKind.FALSE*/:
- this._eat(95/*TokenKind.FALSE*/);
+ this._eat(96/*TokenKind.FALSE*/);
return new LiteralExpression(false, this._boolTypeRef(this._makeSpan(start)), 'false', this._makeSpan(start));
- case 61/*TokenKind.HEX_NUMBER*/:
+ 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));
+
+ case 60/*TokenKind.INTEGER*/:
var t = this._lang_next();
- return new LiteralExpression(lang_Parser.parseHex(t.get$text().substring(2)), this._numTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
+ return new LiteralExpression(Math.parseInt(t.get$text()), this._intTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
- case 60/*TokenKind.NUMBER*/:
+ case 62/*TokenKind.DOUBLE*/:
var t = this._lang_next();
- return new LiteralExpression(Math.parseDouble(t.get$text()), this._numTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
+ return new LiteralExpression(Math.parseDouble(t.get$text()), this._doubleTypeRef(this._makeSpan(start)), t.get$text(), this._makeSpan(start));
case 58/*TokenKind.STRING*/:
return this.stringLiteralExpr();
- case 65/*TokenKind.INCOMPLETE_STRING*/:
+ case 66/*TokenKind.INCOMPLETE_STRING*/:
return this.stringInterpolation();
@@ -14428,15 +14711,15 @@ lang_Parser.prototype.primary = function() {
return this.finishTypedLiteral(start, false);
- case 112/*TokenKind.VOID*/:
- case 111/*TokenKind.VAR*/:
- case 96/*TokenKind.FINAL*/:
+ case 113/*TokenKind.VOID*/:
+ case 112/*TokenKind.VAR*/:
+ case 97/*TokenKind.FINAL*/:
return this.declaredIdentifier(false);
default:
- if (!this._peekIdentifier()) {
+ if ($notnull_bool(!this._peekIdentifier())) {
this._errorExpected('expression');
}
return new VarExpression(this.identifier(), this._makeSpan(start));
@@ -14447,11 +14730,11 @@ lang_Parser.prototype.stringInterpolation = function() {
var start = this._peekToken.start;
var lits = [];
var startQuote = null, endQuote = null;
- while (this._peekKind(65/*TokenKind.INCOMPLETE_STRING*/)) {
+ while ($notnull_bool(this._peekKind(66/*TokenKind.INCOMPLETE_STRING*/))) {
var token = this._lang_next();
var text = token.get$text();
- if (startQuote == null) {
- if (isMultilineString(text)) {
+ if ($notnull_bool(startQuote == null)) {
+ if ($notnull_bool(isMultilineString($assert_String(text)))) {
endQuote = text.substring(0, 3);
startQuote = endQuote + '\n';
}
@@ -14463,8 +14746,8 @@ lang_Parser.prototype.stringInterpolation = function() {
else {
text = startQuote + text.substring(0, text.length - 1) + endQuote;
}
- lits.add(this.makeStringLiteral(text, token.get$span()));
- if (this._maybeEat(6/*TokenKind.LBRACE*/)) {
+ lits.add(this.makeStringLiteral($assert_String(text), token.get$span()));
+ if ($notnull_bool(this._maybeEat(6/*TokenKind.LBRACE*/))) {
lits.add(this.expression());
this._eat(7/*TokenKind.RBRACE*/);
}
@@ -14474,13 +14757,13 @@ lang_Parser.prototype.stringInterpolation = function() {
}
}
var tok = this._lang_next();
- if (tok.kind != 58/*TokenKind.STRING*/) {
+ if ($notnull_bool(tok.kind != 58/*TokenKind.STRING*/)) {
this._errorExpected('interpolated string');
}
var text = startQuote + tok.get$text();
- lits.add(this.makeStringLiteral(text, tok.get$span()));
+ lits.add(this.makeStringLiteral($assert_String(text), tok.get$span()));
var span = this._makeSpan(start);
- return new LiteralExpression(lits, this._stringTypeRef(span), '\$\$\$', span);
+ return new LiteralExpression(lits, this._stringTypeRef((span && span.is$SourceSpan())), '\$\$\$', (span && span.is$SourceSpan()));
}
lang_Parser.prototype.makeStringLiteral = function(text, span) {
return new LiteralExpression(text, this._stringTypeRef(span), text, span);
@@ -14491,14 +14774,14 @@ lang_Parser.prototype.stringLiteralExpr = function() {
}
lang_Parser.prototype.maybeStringLiteral = function() {
var kind = this._peek();
- if ($eq(kind, 58/*TokenKind.STRING*/)) {
+ if ($notnull_bool($eq(kind, 58/*TokenKind.STRING*/))) {
return parseStringLiteral(this._lang_next().get$text());
}
- else if ($eq(kind, 59/*TokenKind.STRING_PART*/)) {
+ else if ($notnull_bool($eq(kind, 59/*TokenKind.STRING_PART*/))) {
this._lang_next();
this._errorExpected('string literal, but found interpolated string start');
}
- else if ($eq(kind, 65/*TokenKind.INCOMPLETE_STRING*/)) {
+ else if ($notnull_bool($eq(kind, 66/*TokenKind.INCOMPLETE_STRING*/))) {
this._lang_next();
this._errorExpected('string literal, but found incomplete string');
}
@@ -14507,14 +14790,14 @@ lang_Parser.prototype.maybeStringLiteral = function() {
lang_Parser.prototype._parenOrLambda = function() {
var start = this._peekToken.start;
var args = this.arguments();
- if (!this._inInitializers && (this._peekKind(9/*TokenKind.ARROW*/) || this._peekKind(6/*TokenKind.LBRACE*/))) {
+ if ($notnull_bool(!this._inInitializers && (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());
}
else {
- if (args.length == 1) {
+ if ($notnull_bool(args.length == 1)) {
return new ParenExpression(args.$index(0).get$value(), this._makeSpan(start));
}
else {
@@ -14534,21 +14817,21 @@ lang_Parser.prototype._specialIdentifier = function(includeOperators) {
this._eat(15/*TokenKind.ELLIPSIS*/);
this._lang_error('rest no longer supported', this._previousToken.get$span());
- name = this.identifier().get$name();
+ name = $assert_String(this.identifier().get$name());
break;
- case 107/*TokenKind.THIS*/:
+ case 108/*TokenKind.THIS*/:
- this._eat(107/*TokenKind.THIS*/);
+ this._eat(108/*TokenKind.THIS*/);
this._eat(14/*TokenKind.DOT*/);
name = ('this.' + this.identifier().get$name() + '');
break;
- case 75/*TokenKind.GET*/:
+ case 76/*TokenKind.GET*/:
- if (!includeOperators) return null;
- this._eat(75/*TokenKind.GET*/);
- if (this._peekIdentifier()) {
+ if ($notnull_bool(!includeOperators)) return null;
+ this._eat(76/*TokenKind.GET*/);
+ if ($notnull_bool(this._peekIdentifier())) {
name = ('get\$' + this.identifier().get$name() + '');
}
else {
@@ -14556,11 +14839,11 @@ lang_Parser.prototype._specialIdentifier = function(includeOperators) {
}
break;
- case 83/*TokenKind.SET*/:
+ case 84/*TokenKind.SET*/:
- if (!includeOperators) return null;
- this._eat(83/*TokenKind.SET*/);
- if (this._peekIdentifier()) {
+ if ($notnull_bool(!includeOperators)) return null;
+ this._eat(84/*TokenKind.SET*/);
+ if ($notnull_bool(this._peekIdentifier())) {
name = ('set\$' + this.identifier().get$name() + '');
}
else {
@@ -14568,18 +14851,18 @@ lang_Parser.prototype._specialIdentifier = function(includeOperators) {
}
break;
- case 82/*TokenKind.OPERATOR*/:
+ case 83/*TokenKind.OPERATOR*/:
- if (!includeOperators) return null;
- this._eat(82/*TokenKind.OPERATOR*/);
+ if ($notnull_bool(!includeOperators)) return null;
+ this._eat(83/*TokenKind.OPERATOR*/);
var kind = this._peek();
- if ($eq(kind, 81/*TokenKind.NEGATE*/)) {
+ if ($notnull_bool($eq(kind, 82/*TokenKind.NEGATE*/))) {
name = '\$negate';
this._lang_next();
}
else {
- name = TokenKind.binaryMethodName(kind);
- if (name == null) {
+ name = TokenKind.binaryMethodName($assert_num(kind));
+ if ($notnull_bool(name == null)) {
name = 'operator';
}
else {
@@ -14599,14 +14882,14 @@ lang_Parser.prototype.declaredIdentifier = function(includeOperators) {
var start = this._peekToken.start;
var myType = null;
var name = this._specialIdentifier(includeOperators);
- if (name == null) {
+ if ($notnull_bool(name == null)) {
myType = this.type(0);
name = this._specialIdentifier(includeOperators);
- if (name == null) {
- if (this._peekIdentifier()) {
+ if ($notnull_bool(name == null)) {
+ if ($notnull_bool(this._peekIdentifier())) {
name = this.identifier();
}
- else if ((myType instanceof NameTypeReference) && myType.names == null) {
+ else if ($notnull_bool((myType instanceof NameTypeReference) && myType.names == null)) {
name = this._typeAsIdentifier(myType);
myType = null;
}
@@ -14617,13 +14900,13 @@ lang_Parser.prototype.declaredIdentifier = function(includeOperators) {
return new DeclaredIdentifier(myType, name, this._makeSpan(start));
}
lang_Parser._hexDigit = function(c) {
- if (c >= 48 && c <= 57) {
+ if ($notnull_bool(c >= 48 && c <= 57)) {
return c - 48;
}
- else if (c >= 97 && c <= 102) {
+ else if ($notnull_bool(c >= 97 && c <= 102)) {
return c - 87;
}
- else if (c >= 65 && c <= 70) {
+ else if ($notnull_bool(c >= 65 && c <= 70)) {
return c - 55;
}
else {
@@ -14633,31 +14916,32 @@ lang_Parser._hexDigit = function(c) {
lang_Parser.parseHex = function(hex) {
var result = 0;
for (var i = 0;
- i < hex.length; i++) {
+ $notnull_bool(i < hex.length); i++) {
var digit = lang_Parser._hexDigit(hex.charCodeAt(i));
- result = (result << 4) + digit;
+ $assert($ne(digit, -1), "digit != -1", "parser.dart", 1238, 14);
+ result = (result << 4) + $assert_num(digit);
}
return result;
}
lang_Parser.prototype.finishNewExpression = function(start, isConst) {
var type0 = this.type(0);
var name = null;
- if (this._maybeEat(14/*TokenKind.DOT*/)) {
+ if ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
name = this.identifier();
}
var args = this.arguments();
return new lang_NewExpression(isConst, type0, name, args, this._makeSpan(start));
}
lang_Parser.prototype.finishListLiteral = function(start, isConst, type0) {
- if (this._maybeEat(56/*TokenKind.INDEX*/)) {
+ if ($notnull_bool(this._maybeEat(56/*TokenKind.INDEX*/))) {
return new ListExpression(isConst, type0, [], this._makeSpan(start));
}
var values = [];
this._eat(4/*TokenKind.LBRACK*/);
- while (!this._maybeEat(5/*TokenKind.RBRACK*/)) {
- if (this.isPrematureEndOfFile()) break;
+ while ($notnull_bool(!this._maybeEat(5/*TokenKind.RBRACK*/))) {
+ if ($notnull_bool(this.isPrematureEndOfFile())) break;
values.add(this.expression());
- if (!this._maybeEat(11/*TokenKind.COMMA*/)) {
+ if ($notnull_bool(!this._maybeEat(11/*TokenKind.COMMA*/))) {
this._eat(5/*TokenKind.RBRACK*/);
break;
}
@@ -14667,12 +14951,12 @@ lang_Parser.prototype.finishListLiteral = function(start, isConst, type0) {
lang_Parser.prototype.finishMapLiteral = function(start, isConst, type0) {
var items = [];
this._eat(6/*TokenKind.LBRACE*/);
- while (!this._maybeEat(7/*TokenKind.RBRACE*/)) {
- if (this.isPrematureEndOfFile()) break;
+ while ($notnull_bool(!this._maybeEat(7/*TokenKind.RBRACE*/))) {
+ if ($notnull_bool(this.isPrematureEndOfFile())) break;
items.add(this.expression());
this._eat(8/*TokenKind.COLON*/);
items.add(this.expression());
- if (!this._maybeEat(11/*TokenKind.COMMA*/)) {
+ if ($notnull_bool(!this._maybeEat(11/*TokenKind.COMMA*/))) {
this._eat(7/*TokenKind.RBRACE*/);
break;
}
@@ -14681,13 +14965,13 @@ lang_Parser.prototype.finishMapLiteral = function(start, isConst, type0) {
}
lang_Parser.prototype.finishTypedLiteral = function(start, isConst) {
var span = this._makeSpan(start);
- var typeToBeNamedLater = new NameTypeReference(false, null, null, span);
- var genericType = this.addTypeArguments(typeToBeNamedLater, 0);
- if (this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind.INDEX*/)) {
- return this.finishListLiteral(start, isConst, genericType);
+ var typeToBeNamedLater = new NameTypeReference(false, null, null, (span && span.is$SourceSpan()));
+ var genericType = this.addTypeArguments((typeToBeNamedLater && typeToBeNamedLater.is$TypeReference()), 0);
+ if ($notnull_bool(this._peekKind(4/*TokenKind.LBRACK*/) || this._peekKind(56/*TokenKind.INDEX*/))) {
+ return this.finishListLiteral(start, isConst, (genericType && genericType.is$TypeReference()));
}
- else if (this._peekKind(6/*TokenKind.LBRACE*/)) {
- return this.finishMapLiteral(start, isConst, genericType);
+ else if ($notnull_bool(this._peekKind(6/*TokenKind.LBRACE*/))) {
+ return this.finishMapLiteral(start, isConst, (genericType && genericType.is$TypeReference()));
}
else {
this._errorExpected('array or map literal');
@@ -14695,15 +14979,15 @@ lang_Parser.prototype.finishTypedLiteral = function(start, isConst) {
}
lang_Parser.prototype._readModifiers = function() {
var modifiers = null;
- while (true) {
+ while ($notnull_bool(true)) {
switch (this._peek()) {
- case 85/*TokenKind.STATIC*/:
- case 96/*TokenKind.FINAL*/:
- case 90/*TokenKind.CONST*/:
- case 70/*TokenKind.ABSTRACT*/:
- case 74/*TokenKind.FACTORY*/:
+ case 86/*TokenKind.STATIC*/:
+ case 97/*TokenKind.FINAL*/:
+ case 91/*TokenKind.CONST*/:
+ case 71/*TokenKind.ABSTRACT*/:
+ case 75/*TokenKind.FACTORY*/:
- if (modifiers == null) modifiers = [];
+ if ($notnull_bool(modifiers == null)) modifiers = [];
modifiers.add(this._lang_next());
break;
@@ -14719,7 +15003,7 @@ lang_Parser.prototype.typeParameter = function() {
var start = this._peekToken.start;
var name = this.identifier();
var myType = null;
- if (this._maybeEat(73/*TokenKind.EXTENDS*/)) {
+ if ($notnull_bool(this._maybeEat(74/*TokenKind.EXTENDS*/))) {
myType = this.type(1);
}
return new TypeParameter(name, myType, this._makeSpan(start));
@@ -14731,13 +15015,13 @@ lang_Parser.prototype.typeParameters = function() {
do {
var tp = this.typeParameter();
ret.add(tp);
- if ((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth == 0) {
+ if ($notnull_bool((tp.extendsType instanceof GenericTypeReference) && tp.extendsType.depth == 0)) {
closed = true;
break;
}
}
- while (this._maybeEat(11/*TokenKind.COMMA*/))
- if (!closed) {
+ while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
+ if ($notnull_bool(!closed)) {
this._eat(53/*TokenKind.GT*/);
}
return ret;
@@ -14746,13 +15030,13 @@ lang_Parser.prototype.get$typeParameters = function() {
return lang_Parser.prototype.typeParameters.bind(this);
}
lang_Parser.prototype._eatClosingAngle = function(depth) {
- if (this._maybeEat(53/*TokenKind.GT*/)) {
+ if ($notnull_bool(this._maybeEat(53/*TokenKind.GT*/))) {
return depth;
}
- else if (depth > 0 && this._maybeEat(40/*TokenKind.SAR*/)) {
+ else if ($notnull_bool(depth > 0 && this._maybeEat(40/*TokenKind.SAR*/))) {
return depth - 1;
}
- else if (depth > 1 && this._maybeEat(41/*TokenKind.SHR*/)) {
+ else if ($notnull_bool(depth > 1 && this._maybeEat(41/*TokenKind.SHR*/))) {
return depth - 2;
}
else {
@@ -14769,27 +15053,27 @@ lang_Parser.prototype._finishTypeArguments = function(baseType, depth, types) {
do {
var myType = this.type(depth + 1);
types.add(myType);
- if ((myType instanceof GenericTypeReference) && myType.depth <= depth) {
+ if ($notnull_bool((myType instanceof GenericTypeReference) && myType.depth <= depth)) {
delta = depth - myType.depth;
break;
}
}
- while (this._maybeEat(11/*TokenKind.COMMA*/))
- if (delta >= 0) {
- depth = depth - delta;
+ while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
+ if ($notnull_bool(delta >= 0)) {
+ depth -= $assert_num(delta);
}
else {
depth = this._eatClosingAngle(depth);
}
var span = this._makeSpan(baseType.span.start);
- return new GenericTypeReference(baseType, types, depth, span);
+ return new GenericTypeReference(baseType, types, depth, (span && span.is$SourceSpan()));
}
lang_Parser.prototype.typeList = function() {
var types = [];
do {
types.add(this.type(0));
}
- while (this._maybeEat(11/*TokenKind.COMMA*/))
+ while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/)))
return types;
}
lang_Parser.prototype.type = function(depth) {
@@ -14799,17 +15083,17 @@ lang_Parser.prototype.type = function(depth) {
var typeArgs = null;
var isFinal = false;
switch (this._peek()) {
- case 112/*TokenKind.VOID*/:
+ case 113/*TokenKind.VOID*/:
return new TypeReference(this._lang_next().get$span(), world.voidType);
- case 111/*TokenKind.VAR*/:
+ case 112/*TokenKind.VAR*/:
return new TypeReference(this._lang_next().get$span(), world.varType);
- case 96/*TokenKind.FINAL*/:
+ case 97/*TokenKind.FINAL*/:
- this._eat(96/*TokenKind.FINAL*/);
+ this._eat(97/*TokenKind.FINAL*/);
isFinal = true;
name = this.identifier();
break;
@@ -14820,13 +15104,13 @@ lang_Parser.prototype.type = function(depth) {
break;
}
- while (this._maybeEat(14/*TokenKind.DOT*/)) {
- if (names == null) names = [];
+ while ($notnull_bool(this._maybeEat(14/*TokenKind.DOT*/))) {
+ if ($notnull_bool(names == null)) names = [];
names.add(this.identifier());
}
var typeRef = new NameTypeReference(isFinal, name, names, this._makeSpan(start));
- if (this._peekKind(52/*TokenKind.LT*/)) {
- return this.addTypeArguments(typeRef, depth);
+ if ($notnull_bool(this._peekKind(52/*TokenKind.LT*/))) {
+ return this.addTypeArguments((typeRef && typeRef.is$TypeReference()), depth);
}
else {
return typeRef;
@@ -14840,18 +15124,18 @@ lang_Parser.prototype.formalParameter = function(inOptionalBlock) {
var type0 = di.type;
var name = di.get$name();
var value = null;
- if (this._maybeEat(20/*TokenKind.ASSIGN*/)) {
- if (!inOptionalBlock) {
+ if ($notnull_bool(this._maybeEat(20/*TokenKind.ASSIGN*/))) {
+ if ($notnull_bool(!inOptionalBlock)) {
this._lang_error('default values only allowed inside [optional] section');
}
value = this.expression();
}
- else if (this._peekKind(2/*TokenKind.LPAREN*/)) {
+ else if ($notnull_bool(this._peekKind(2/*TokenKind.LPAREN*/))) {
var formals = this.formalParameterList();
var func = new FunctionDefinition(null, type0, name, formals, null, null, this._makeSpan(start));
type0 = new FunctionTypeReference(false, func, func.get$span());
}
- if (inOptionalBlock && value == null) {
+ if ($notnull_bool(inOptionalBlock && value == null)) {
value = new NullExpression(this._makeSpan(start));
}
return new FormalNode(isThis, isRest, type0, name, value, this._makeSpan(start));
@@ -14860,21 +15144,21 @@ lang_Parser.prototype.formalParameterList = function() {
this._eat(2/*TokenKind.LPAREN*/);
var formals = [];
var inOptionalBlock = false;
- if (!this._maybeEat(3/*TokenKind.RPAREN*/)) {
- if (this._maybeEat(4/*TokenKind.LBRACK*/)) {
+ if ($notnull_bool(!this._maybeEat(3/*TokenKind.RPAREN*/))) {
+ if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) {
inOptionalBlock = true;
}
- formals.add(this.formalParameter(inOptionalBlock));
- while (this._maybeEat(11/*TokenKind.COMMA*/)) {
- if (this._maybeEat(4/*TokenKind.LBRACK*/)) {
- if (inOptionalBlock) {
+ formals.add(this.formalParameter($assert_bool(inOptionalBlock)));
+ while ($notnull_bool(this._maybeEat(11/*TokenKind.COMMA*/))) {
+ if ($notnull_bool(this._maybeEat(4/*TokenKind.LBRACK*/))) {
+ if ($notnull_bool(inOptionalBlock)) {
this._lang_error('already inside an optional block', this._previousToken.get$span());
}
inOptionalBlock = true;
}
- formals.add(this.formalParameter(inOptionalBlock));
+ formals.add(this.formalParameter($assert_bool(inOptionalBlock)));
}
- if (inOptionalBlock) {
+ if ($notnull_bool(inOptionalBlock)) {
this._eat(5/*TokenKind.RBRACK*/);
}
this._eat(3/*TokenKind.RPAREN*/);
@@ -14883,19 +15167,19 @@ lang_Parser.prototype.formalParameterList = function() {
}
lang_Parser.prototype.identifier = function() {
var tok = this._lang_next();
- if (!TokenKind.isIdentifier(tok.kind)) {
+ if ($notnull_bool(!TokenKind.isIdentifier(tok.kind))) {
this._lang_error(('expected identifier, but found ' + tok + ''), tok.get$span());
}
return new lang_Identifier(tok.get$text(), this._makeSpan(tok.start));
}
lang_Parser.prototype._makeFunction = function(expr, body) {
var name, type0;
- if ((expr instanceof CallExpression)) {
- if ((expr.target instanceof VarExpression)) {
+ if ($notnull_bool((expr instanceof CallExpression))) {
+ if ($notnull_bool((expr.target instanceof VarExpression))) {
name = expr.target.get$name();
type0 = null;
}
- else if ((expr.target instanceof DeclaredIdentifier)) {
+ else if ($notnull_bool((expr.target instanceof DeclaredIdentifier))) {
name = expr.target.get$name();
type0 = expr.target.type;
}
@@ -14904,7 +15188,7 @@ lang_Parser.prototype._makeFunction = function(expr, body) {
}
var formals = this._makeFormals(expr.get$arguments());
var span = new SourceSpan(expr.get$span().file, expr.get$span().start, body.get$span().end);
- var func = new FunctionDefinition(null, type0, name, formals, null, body, span);
+ var func = new FunctionDefinition(null, type0, name, formals, null, body, (span && span.is$SourceSpan()));
return new LambdaExpression(func, func.get$span());
}
else {
@@ -14912,20 +15196,20 @@ lang_Parser.prototype._makeFunction = function(expr, body) {
}
}
lang_Parser.prototype._makeFormal = function(expr) {
- if ((expr instanceof VarExpression)) {
+ if ($notnull_bool((expr instanceof VarExpression))) {
return new FormalNode(false, false, null, expr.get$name(), null, expr.get$span());
}
- else if ((expr instanceof DeclaredIdentifier)) {
+ else if ($notnull_bool((expr instanceof DeclaredIdentifier))) {
return new FormalNode(false, false, expr.type, expr.get$name(), null, expr.get$span());
}
- else if (this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.x instanceof DeclaredIdentifier))) {
+ else if ($notnull_bool(this._isBin(expr, 20/*TokenKind.ASSIGN*/) && ((expr.x instanceof DeclaredIdentifier)))) {
var di = expr.x;
return new FormalNode(false, false, di.type, di.name, expr.y, expr.get$span());
}
- else if (this._isBin(expr, 52/*TokenKind.LT*/)) {
+ else if ($notnull_bool(this._isBin(expr, 52/*TokenKind.LT*/))) {
return null;
}
- else if ((expr instanceof ListExpression)) {
+ else if ($notnull_bool((expr instanceof ListExpression))) {
return this._makeFormalsFromList(expr);
}
else {
@@ -14933,10 +15217,10 @@ lang_Parser.prototype._makeFormal = function(expr) {
}
}
lang_Parser.prototype._makeFormalsFromList = function(expr) {
- if (expr.get$isConst()) {
+ if ($notnull_bool(expr.get$isConst())) {
this._lang_error('expected formal, but found "const"', expr.get$span());
}
- else if ($ne(expr.type, null)) {
+ else if ($notnull_bool($ne(expr.type, null))) {
this._lang_error('expected formal, but found generic type arguments', expr.type.get$span());
}
return this._makeFormalsFromExpressions(expr.values, false);
@@ -14944,9 +15228,9 @@ lang_Parser.prototype._makeFormalsFromList = function(expr) {
lang_Parser.prototype._makeFormals = function(arguments0) {
var expressions = [];
for (var i = 0;
- i < arguments0.length; i++) {
+ $notnull_bool(i < arguments0.length); i++) {
var arg = arguments0.$index(i);
- if (arg.label != null) {
+ if ($notnull_bool(arg.label != null)) {
this._lang_error('expected formal, but found ":"');
}
expressions.add(arg.get$value());
@@ -14956,19 +15240,19 @@ lang_Parser.prototype._makeFormals = function(arguments0) {
lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowOptional) {
var formals = [];
for (var i = 0;
- i < expressions.length; i++) {
+ $notnull_bool(i < expressions.length); i++) {
var formal = this._makeFormal(expressions.$index(i));
- if (formal == null) {
+ if ($notnull_bool(formal == null)) {
var baseType = this._makeType(expressions.$index(i).x);
var typeParams = [this._makeType(expressions.$index(i).y)];
i++;
- while (i < expressions.length) {
+ while ($notnull_bool(i < expressions.length)) {
var expr = expressions.$index(i++);
- if (this._isBin(expr, 53/*TokenKind.GT*/)) {
+ if ($notnull_bool(this._isBin(expr, 53/*TokenKind.GT*/))) {
typeParams.add(this._makeType(expr.x));
var type0 = new GenericTypeReference(baseType, typeParams, 0, this._makeSpan(baseType.get$span().start));
var name = null;
- if ((expr.y instanceof VarExpression)) {
+ if ($notnull_bool((expr.y instanceof VarExpression))) {
var ve = expr.y;
name = ve.name;
}
@@ -14984,9 +15268,9 @@ lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO
}
formals.add(formal);
}
- else if (!!(formal && formal.is$List)) {
+ else if ($notnull_bool(!!(formal && formal.is$List))) {
formals.addAll(formal);
- if (!allowOptional) {
+ if ($notnull_bool(!allowOptional)) {
this._lang_error('unexpected nested optional formal', expressions.$index(i).get$span());
}
}
@@ -14997,10 +15281,10 @@ lang_Parser.prototype._makeFormalsFromExpressions = function(expressions, allowO
return formals;
}
lang_Parser.prototype._makeDeclaredIdentifier = function(e) {
- if ((e instanceof VarExpression)) {
+ if ($notnull_bool((e instanceof VarExpression))) {
return new DeclaredIdentifier(null, e.get$name(), e.get$span());
}
- else if ((e instanceof DeclaredIdentifier)) {
+ else if ($notnull_bool((e instanceof DeclaredIdentifier))) {
return e;
}
else {
@@ -15009,7 +15293,7 @@ lang_Parser.prototype._makeDeclaredIdentifier = function(e) {
}
}
lang_Parser.prototype._makeLabel = function(expr) {
- if ((expr instanceof VarExpression)) {
+ if ($notnull_bool((expr instanceof VarExpression))) {
return expr.get$name();
}
else {
@@ -15022,6 +15306,7 @@ function lang_Node(span) {
this.span = span;
// Initializers done
}
+lang_Node.prototype.is$lang_Node = function(){return this;};
lang_Node.prototype.get$span = function() { return this.span; };
lang_Node.prototype.set$span = function(value) { return this.span = value; };
// ********** Code for Definition **************
@@ -15030,6 +15315,7 @@ function Definition(span0) {
// Initializers done
}
$inherits(Definition, lang_Statement);
+Definition.prototype.is$Definition = function(){return this;};
Definition.prototype.get$typeParameters = function() {
return null;
}
@@ -15039,12 +15325,14 @@ function lang_Statement(span0) {
// Initializers done
}
$inherits(lang_Statement, lang_Node);
+lang_Statement.prototype.is$lang_Statement = function(){return this;};
// ********** Code for lang_Expression **************
function lang_Expression(span0) {
lang_Node.call(this, span0);
// Initializers done
}
$inherits(lang_Expression, lang_Node);
+lang_Expression.prototype.is$lang_Expression = function(){return this;};
// ********** Code for TypeReference **************
function TypeReference(span0, type) {
this.type = type;
@@ -15052,6 +15340,7 @@ function TypeReference(span0, type) {
// Initializers done
}
$inherits(TypeReference, lang_Node);
+TypeReference.prototype.is$TypeReference = function(){return this;};
TypeReference.prototype.visit = function(visitor) {
return visitor.visitTypeReference(this);
}
@@ -15131,6 +15420,7 @@ function FunctionDefinition(modifiers, returnType, name, formals, initializers,
// Initializers done
}
$inherits(FunctionDefinition, Definition);
+FunctionDefinition.prototype.is$FunctionDefinition = function(){return this;};
FunctionDefinition.prototype.get$returnType = function() { return this.returnType; };
FunctionDefinition.prototype.set$returnType = function(value) { return this.returnType = value; };
FunctionDefinition.prototype.get$name = function() { return this.name; };
@@ -15353,6 +15643,7 @@ function CallExpression(target, arguments, span0) {
// Initializers done
}
$inherits(CallExpression, lang_Expression);
+CallExpression.prototype.is$CallExpression = function(){return this;};
CallExpression.prototype.get$arguments = function() { return this.arguments; };
CallExpression.prototype.set$arguments = function(value) { return this.arguments = value; };
CallExpression.prototype.visit = function(visitor) {
@@ -15366,6 +15657,7 @@ function IndexExpression(target, index, span0) {
// Initializers done
}
$inherits(IndexExpression, lang_Expression);
+IndexExpression.prototype.is$IndexExpression = function(){return this;};
IndexExpression.prototype.visit = function(visitor) {
return visitor.visitIndexExpression(this);
}
@@ -15378,6 +15670,7 @@ function BinaryExpression(op, x, y, span0) {
// Initializers done
}
$inherits(BinaryExpression, lang_Expression);
+BinaryExpression.prototype.is$BinaryExpression = function(){return this;};
BinaryExpression.prototype.visit = function(visitor) {
return visitor.visitBinaryExpression(this);
}
@@ -15400,6 +15693,7 @@ function PostfixExpression(body, op, span0) {
// Initializers done
}
$inherits(PostfixExpression, lang_Expression);
+PostfixExpression.prototype.is$PostfixExpression = function(){return this;};
PostfixExpression.prototype.visit = function(visitor) {
return visitor.visitPostfixExpression$1(this);
}
@@ -15492,6 +15786,7 @@ function DotExpression(self, name, span0) {
// Initializers done
}
$inherits(DotExpression, lang_Expression);
+DotExpression.prototype.is$DotExpression = function(){return this;};
DotExpression.prototype.get$name = function() { return this.name; };
DotExpression.prototype.set$name = function(value) { return this.name = value; };
DotExpression.prototype.visit = function(visitor) {
@@ -15504,6 +15799,7 @@ function VarExpression(name, span0) {
// Initializers done
}
$inherits(VarExpression, lang_Expression);
+VarExpression.prototype.is$VarExpression = function(){return this;};
VarExpression.prototype.get$name = function() { return this.name; };
VarExpression.prototype.set$name = function(value) { return this.name = value; };
VarExpression.prototype.visit = function(visitor) {
@@ -15561,6 +15857,7 @@ function NameTypeReference(isFinal, name, names, span0) {
// Initializers done
}
$inherits(NameTypeReference, TypeReference);
+NameTypeReference.prototype.is$NameTypeReference = function(){return this;};
NameTypeReference.prototype.get$name = function() { return this.name; };
NameTypeReference.prototype.set$name = function(value) { return this.name = value; };
NameTypeReference.prototype.visit = function(visitor) {
@@ -15597,6 +15894,7 @@ function ArgumentNode(label, value, span0) {
// Initializers done
}
$inherits(ArgumentNode, lang_Node);
+ArgumentNode.prototype.is$ArgumentNode = function(){return this;};
ArgumentNode.prototype.get$value = function() { return this.value; };
ArgumentNode.prototype.set$value = function(value) { return this.value = value; };
ArgumentNode.prototype.visit = function(visitor) {
@@ -15679,6 +15977,7 @@ function DeclaredIdentifier(type, name, span0) {
// Initializers done
}
$inherits(DeclaredIdentifier, lang_Expression);
+DeclaredIdentifier.prototype.is$DeclaredIdentifier = function(){return this;};
DeclaredIdentifier.prototype.get$name = function() { return this.name; };
DeclaredIdentifier.prototype.set$name = function(value) { return this.name = value; };
DeclaredIdentifier.prototype.visit = function(visitor) {
@@ -15690,13 +15989,16 @@ function lang_Type(name) {
this.isTested = false;
// Initializers done
}
+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.markUsed = function() {
}
lang_Type.prototype.get$typeMember = function() {
- if (this._typeMember == null) {
- this._typeMember = new TypeMember(this);
+ var $0;
+ if ($notnull_bool(this._typeMember == null)) {
+ this._typeMember = new TypeMember((($0 = this) && $0.is$DefinedType()));
}
return this._typeMember;
}
@@ -15758,7 +16060,7 @@ lang_Type.prototype.get$typeofName = function() {
return null;
}
lang_Type.prototype.get$jsname = function() {
- return this._jsname == null ? this.name : this._jsname;
+ return $notnull_bool(this._jsname == null) ? this.name : this._jsname;
}
lang_Type.prototype.set$jsname = function(name0) {
return this._jsname = name0;
@@ -15782,32 +16084,32 @@ lang_Type.prototype.hashCode = function() {
return this.name.hashCode();
}
lang_Type.prototype.ensureSubtypeOf = function(other, span0, typeErrors) {
- if (!this.isSubtypeOf(other)) {
+ if ($notnull_bool(!this.isSubtypeOf(other))) {
var msg = ('type ' + this.name + ' is not a subtype of ' + other.name + '');
- if (typeErrors) {
- world.error(msg, span0);
+ if ($notnull_bool(typeErrors)) {
+ world.error($assert_String(msg), span0);
}
else {
- world.warning(msg, span0);
+ world.warning($assert_String(msg), span0);
}
}
}
lang_Type.prototype.needsVarCall = function(args) {
- if (this.get$isVarOrFunction()) {
+ if ($notnull_bool(this.get$isVarOrFunction())) {
return true;
}
var call = this.getCallMethod();
- if ($ne(call, null)) {
- if (args.get$length() != call.get$parameters().length || !call.namesInOrder(args)) {
+ if ($notnull_bool($ne(call, null))) {
+ if ($notnull_bool(args.get$length() != call.get$parameters().length || !call.namesInOrder(args))) {
return true;
}
}
return false;
}
lang_Type.union = function(x, y) {
- if ($eq(x, y)) return x;
- if (x.get$isNum() && y.get$isNum()) return world.numType;
- if (x.get$isString() && y.get$isString()) return world.stringType;
+ if ($notnull_bool($eq(x, y))) return x;
+ if ($notnull_bool(x.get$isNum() && y.get$isNum())) return world.numType;
+ if ($notnull_bool(x.get$isString() && y.get$isString())) return world.stringType;
return world.varType;
}
lang_Type.prototype.isAssignable = function(other) {
@@ -15815,11 +16117,11 @@ lang_Type.prototype.isAssignable = function(other) {
}
lang_Type.prototype._isDirectSupertypeOf = function(other) {
var $this = this; // closure support
- if (other.get$isClass()) {
+ if ($notnull_bool(other.get$isClass())) {
return $eq(other.get$parent(), this) || this.get$isObject() && other.get$parent() == null;
}
else {
- if (other.get$interfaces() == null || other.get$interfaces().isEmpty()) {
+ if ($notnull_bool(other.get$interfaces() == null || other.get$interfaces().isEmpty())) {
return this.get$isObject();
}
else {
@@ -15831,51 +16133,52 @@ lang_Type.prototype._isDirectSupertypeOf = function(other) {
}
}
lang_Type.prototype.isSubtypeOf = function(other) {
- if ((other instanceof ParameterType)) {
+ if ($notnull_bool((other instanceof ParameterType))) {
return true;
}
- if ($eq(this, other)) return true;
- if (this.get$isVar()) return true;
- if (other.get$isVar()) return true;
- if (other._isDirectSupertypeOf(this)) return true;
+ if ($notnull_bool($eq(this, other))) return true;
+ if ($notnull_bool(this.get$isVar())) return true;
+ if ($notnull_bool(other.get$isVar())) return true;
+ if ($notnull_bool(other._isDirectSupertypeOf(this))) return true;
var call = this.getCallMethod();
var otherCall = other.getCallMethod();
- if ($ne(call, null) && $ne(otherCall, null)) {
- return lang_Type._isFunctionSubtypeOf(call, otherCall);
+ if ($notnull_bool($ne(call, null) && $ne(otherCall, null))) {
+ return lang_Type._isFunctionSubtypeOf((call && call.is$MethodMember()), (otherCall && otherCall.is$MethodMember()));
}
- if ($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($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)) {
var t = this.get$typeArgsInOrder().iterator();
var s = other.get$typeArgsInOrder().iterator();
- while (t.hasNext()) {
- if (!t.next().isSubtypeOf(s.next())) return false;
+ while ($notnull_bool(t.hasNext())) {
+ if ($notnull_bool(!t.next().isSubtypeOf(s.next()))) return false;
}
return true;
}
- if (this.get$parent() != null && this.get$parent().isSubtypeOf(other)) {
+ if ($notnull_bool(this.get$parent() != null && this.get$parent().isSubtypeOf(other))) {
return true;
}
- if (this.get$interfaces() != null && this.get$interfaces().some((function (i) {
+ if ($notnull_bool(this.get$interfaces() != null && this.get$interfaces().some((function (i) {
return i.isSubtypeOf(other);
})
- )) {
+ ))) {
return true;
}
return false;
}
lang_Type._isFunctionSubtypeOf = function(t, s) {
- if (!s.returnType.get$isVoid() && !s.returnType.isAssignable(t.returnType)) {
+ var $0;
+ if ($notnull_bool(!s.returnType.get$isVoid() && !s.returnType.isAssignable(t.returnType))) {
return false;
}
var tp = t.parameters;
var sp = s.parameters;
- if (tp.length < sp.length) return false;
+ if ($notnull_bool(tp.length < 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;
- if (tp.$index(i).get$isOptional() && $ne(tp.$index(i).get$name(), sp.$index(i).get$name())) return false;
- if (!tp.$index(i).type.isAssignable(sp.$index(i).type)) return false;
+ $notnull_bool(i < 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((($0 = sp.$index(i).type) && $0.is$lang_Type())))) return false;
}
- if (tp.length > sp.length && !tp.$index(sp.length).get$isOptional()) return false;
+ if ($notnull_bool(tp.length > sp.length && !tp.$index(sp.length).get$isOptional())) return false;
return true;
}
// ********** Code for ParameterType **************
@@ -15913,7 +16216,7 @@ ParameterType.prototype.resolveTypeParams = function(inType) {
return inType.typeArguments.$index(this.name);
}
ParameterType.prototype.resolve = function(inType) {
- if (this.typeParameter.extendsType != null) {
+ if ($notnull_bool(this.typeParameter.extendsType != null)) {
this.extendsType = inType.resolveType(this.typeParameter.extendsType, true);
}
else {
@@ -15960,10 +16263,10 @@ ConcreteType.prototype.resolveTypeParams = function(inType) {
for (var $i = 0;$i < $list.length; $i++) {
var t = $list.$index($i);
var newType = t.resolveTypeParams(inType);
- if ($ne(newType, t)) needsNewType = true;
+ if ($notnull_bool($ne(newType, t))) needsNewType = true;
newTypeArgs.add(newType);
}
- if (!needsNewType) return this;
+ if ($notnull_bool(!needsNewType)) return this;
return this.genericType.getOrMakeConcreteType(newTypeArgs);
}
ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) {
@@ -15973,7 +16276,7 @@ ConcreteType.prototype.get$parent = function() {
return this.genericType.get$parent();
}
ConcreteType.prototype.get$interfaces = function() {
- if (this._interfaces == null && this.genericType.get$interfaces() != null) {
+ if ($notnull_bool(this._interfaces == null && this.genericType.get$interfaces() != null)) {
this._interfaces = [];
var $list = this.genericType.get$interfaces();
for (var $i = 0;$i < $list.length; $i++) {
@@ -15987,12 +16290,13 @@ ConcreteType.prototype.getCallMethod = function() {
return this.genericType.getCallMethod();
}
ConcreteType.prototype.getAllMembers = function() {
+ var $0;
var result = this.genericType.getAllMembers();
var $list = result.getKeys();
for (var $i = result.getKeys().iterator(); $i.hasNext(); ) {
var memberName = $i.next();
var myMember = this.members.$index(memberName);
- if ($ne(myMember, null)) {
+ if ($notnull_bool($ne(myMember, null))) {
result.$setindex(memberName, myMember);
}
}
@@ -16009,19 +16313,19 @@ ConcreteType.prototype.getFactory = function(type, constructorName) {
}
ConcreteType.prototype.getConstructor = function(constructorName) {
var ret = this.constructors.$index(constructorName);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
ret = this.factories.getFactory(this.name, constructorName);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
var genericMember = this.genericType.getConstructor(constructorName);
- if (genericMember == null) return null;
- if ($ne(genericMember.declaringType, this.genericType)) {
- if (!genericMember.declaringType.get$isGeneric()) return genericMember;
+ if ($notnull_bool(genericMember == null)) return null;
+ if ($notnull_bool($ne(genericMember.declaringType, this.genericType))) {
+ if ($notnull_bool(!genericMember.declaringType.get$isGeneric())) return genericMember;
var newDeclaringType = genericMember.declaringType.getOrMakeConcreteType(this.typeArgsInOrder);
return newDeclaringType.getConstructor(constructorName);
}
- if (genericMember.get$isFactory()) {
- ret = new ConcreteMember(genericMember.get$name(), this, genericMember);
- this.factories.addFactory(this.name, constructorName, ret);
+ if ($notnull_bool(genericMember.get$isFactory())) {
+ ret = new ConcreteMember($assert_String(genericMember.get$name()), this, genericMember);
+ this.factories.addFactory(this.name, constructorName, (ret && ret.is$Member()));
}
else {
ret = new ConcreteMember(this.name, this, genericMember);
@@ -16031,23 +16335,24 @@ ConcreteType.prototype.getConstructor = function(constructorName) {
}
ConcreteType.prototype.getMember = function(memberName) {
var ret = this.members.$index(memberName);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
var genericMember = this.genericType.getMember(memberName);
- if (genericMember == null) return null;
- ret = new ConcreteMember(genericMember.get$name(), this, genericMember);
+ if ($notnull_bool(genericMember == null)) return null;
+ ret = new ConcreteMember($assert_String(genericMember.get$name()), this, genericMember);
this.members.$setindex(memberName, ret);
return ret;
}
ConcreteType.prototype.resolveMember = function(memberName) {
+ var $0;
var mem = this.getMember(memberName);
- if (mem == null) return null;
- var ret = new MemberSet(mem);
- if (mem.get$isStatic()) return ret;
+ if ($notnull_bool(mem == null)) return null;
+ var ret = new MemberSet((mem && mem.is$Member()));
+ if ($notnull_bool(mem.get$isStatic())) return ret;
var $list = this.genericType.get$subtypes();
for (var $i = this.genericType.get$subtypes().iterator(); $i.hasNext(); ) {
var t = $i.next();
var m = t.members.$index(memberName);
- if ($ne(m, null)) ret.add(m);
+ if ($notnull_bool($ne(m, null))) ret.add(m);
}
return ret;
}
@@ -16074,6 +16379,7 @@ function DefinedType(name0, library, definition0, isClass) {
this.setDefinition(definition0);
}
$inherits(DefinedType, lang_Type);
+DefinedType.prototype.is$DefinedType = function(){return this;};
DefinedType.prototype.get$definition = function() { return this.definition; };
DefinedType.prototype.set$definition = function(value) { return this.definition = value; };
DefinedType.prototype.get$library = function() { return this.library; };
@@ -16089,24 +16395,25 @@ DefinedType.prototype.set$isUsed = function(value) { return this.isUsed = value;
DefinedType.prototype.get$isNativeType = function() { return this.isNativeType; };
DefinedType.prototype.set$isNativeType = function(value) { return this.isNativeType = value; };
DefinedType.prototype.setDefinition = function(def) {
+ $assert(this.definition == null, "definition == null", "type.dart", 541, 12);
this.definition = def;
- if ((this.definition instanceof TypeDefinition) && this.definition.nativeType != null) {
+ if ($notnull_bool((this.definition instanceof TypeDefinition) && this.definition.nativeType != null)) {
this.isNativeType = true;
}
- if (this.definition != null && this.definition.get$typeParameters() != null) {
+ if ($notnull_bool(this.definition != null && this.definition.get$typeParameters() != null)) {
this._concreteTypes = $map([]);
this.typeParameters = [];
var $list = this.definition.get$typeParameters();
for (var $i = 0;$i < $list.length; $i++) {
var tp = $list.$index($i);
var paramName = tp.get$name().get$name();
- this.typeParameters.add(new ParameterType(paramName, tp));
+ this.typeParameters.add(new ParameterType($assert_String(paramName), tp));
}
}
}
DefinedType.prototype.get$typeArgsInOrder = function() {
- if (this.typeParameters == null) return null;
- if (this._typeArgsInOrder == null) {
+ if ($notnull_bool(this.typeParameters == null)) return null;
+ if ($notnull_bool(this._typeArgsInOrder == null)) {
this._typeArgsInOrder = new FixedCollection$Type(world.varType, this.typeParameters.length);
}
return this._typeArgsInOrder;
@@ -16139,14 +16446,14 @@ DefinedType.prototype.get$isGeneric = function() {
return this.typeParameters != null;
}
DefinedType.prototype.get$span = function() {
- return this.definition == null ? null : this.definition.span;
+ return $notnull_bool(this.definition == null) ? null : this.definition.span;
}
DefinedType.prototype.get$typeofName = function() {
- if (!this.library.get$isCore()) return null;
- if (this.get$isBool()) return 'boolean';
- else if (this.get$isNum()) return 'number';
- else if (this.get$isString()) return 'string';
- else if (this.get$isFunction()) return 'function';
+ if ($notnull_bool(!this.library.get$isCore())) return null;
+ if ($notnull_bool(this.get$isBool())) return 'boolean';
+ else if ($notnull_bool(this.get$isNum())) return 'number';
+ else if ($notnull_bool(this.get$isString())) return 'string';
+ else if ($notnull_bool(this.get$isFunction())) return 'function';
else return null;
}
DefinedType.prototype.get$isNum = function() {
@@ -16159,34 +16466,34 @@ DefinedType.prototype.getAllMembers = function() {
return HashMapImplementation.HashMapImplementation$from$factory(this.members);
}
DefinedType.prototype.markUsed = function() {
- if (this.isUsed) return;
+ if ($notnull_bool(this.isUsed)) return;
this.isUsed = true;
- if (this._lazyGenMethods != null) {
+ if ($notnull_bool(this._lazyGenMethods != null)) {
var $list = orderValuesByKeys(this._lazyGenMethods);
for (var $i = 0;$i < $list.length; $i++) {
var method = $list.$index($i);
- world.gen.genMethod(method);
+ world.gen.genMethod((method && method.is$Member()));
}
this._lazyGenMethods = null;
}
- if (this.parent != null) this.parent.markUsed();
+ if ($notnull_bool(this.parent != null)) this.parent.markUsed();
}
DefinedType.prototype.genMethod = function(method) {
- if (this.isUsed) {
+ if ($notnull_bool(this.isUsed)) {
world.gen.genMethod(method);
}
- else if (this.isClass) {
- if (this._lazyGenMethods == null) this._lazyGenMethods = $map([]);
+ else if ($notnull_bool(this.isClass)) {
+ if ($notnull_bool(this._lazyGenMethods == null)) this._lazyGenMethods = $map([]);
this._lazyGenMethods.$setindex(method.name, method);
}
}
DefinedType.prototype._resolveInterfaces = function(types) {
- if (types == null) return [];
+ if ($notnull_bool(types == null)) return [];
var interfaces0 = [];
for (var $i = 0;$i < types.length; $i++) {
var type = types.$index($i);
- var resolvedInterface = this.resolveType(type, true);
- if (resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this.library.get$isCoreImpl())) {
+ var resolvedInterface = this.resolveType((type && type.is$TypeReference()), true);
+ if ($notnull_bool(resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this.library.get$isCoreImpl()))) {
world.error(('can not implement "' + resolvedInterface.get$name() + '": ') + 'only native implementation allowed', type.get$span());
}
resolvedInterface.addDirectSubtype(this);
@@ -16195,10 +16502,12 @@ DefinedType.prototype._resolveInterfaces = function(types) {
return interfaces0;
}
DefinedType.prototype.addDirectSubtype = function(type) {
+ $assert(this._subtypes == null, "_subtypes == null", "type.dart", 657, 12);
this.directSubtypes.add(type);
}
DefinedType.prototype.get$subtypes = function() {
- if (this._subtypes == null) {
+ var $0;
+ if ($notnull_bool(this._subtypes == null)) {
this._subtypes = new HashSetImplementation$Type();
var $list = this.directSubtypes;
for (var $i = this.directSubtypes.iterator(); $i.hasNext(); ) {
@@ -16213,11 +16522,11 @@ DefinedType.prototype._cycleInClassExtends = function() {
var seen = new HashSetImplementation();
seen.add(this);
var ancestor = this.parent;
- while ($ne(ancestor, null)) {
- if (ancestor === this) {
+ while ($notnull_bool($ne(ancestor, null))) {
+ if ($notnull_bool(ancestor === this)) {
return true;
}
- if (seen.contains(ancestor)) {
+ if ($notnull_bool(seen.contains(ancestor))) {
return false;
}
seen.add(ancestor);
@@ -16230,80 +16539,81 @@ DefinedType.prototype._cycleInInterfaceExtends = function() {
var seen = new HashSetImplementation();
seen.add(this);
function _helper(ancestor) {
- if (ancestor == null) return false;
- if (ancestor === $this) return true;
- if (seen.contains(ancestor)) {
+ if ($notnull_bool(ancestor == null)) return false;
+ if ($notnull_bool(ancestor === $this)) return true;
+ if ($notnull_bool(seen.contains(ancestor))) {
return false;
}
seen.add(ancestor);
- if (ancestor.get$interfaces() != null) {
+ if ($notnull_bool(ancestor.get$interfaces() != null)) {
var $list = ancestor.get$interfaces();
for (var $i = 0;$i < $list.length; $i++) {
var parent0 = $list.$index($i);
- if (_helper(parent0)) return true;
+ if ($notnull_bool(_helper(parent0))) return true;
}
}
return false;
}
for (var i = 0;
- i < this.interfaces.length; i++) {
- if (_helper(this.interfaces.$index(i))) return i;
+ $notnull_bool(i < this.interfaces.length); i++) {
+ if ($notnull_bool(_helper(this.interfaces.$index(i)))) return i;
}
return -1;
}
DefinedType.prototype.resolve = function() {
var $this = this; // closure support
- if ((this.definition instanceof TypeDefinition)) {
- if (this.isClass) {
- if (this.definition.extendsTypes != null && this.definition.extendsTypes.length > 0) {
- if (this.definition.extendsTypes.length > 1) {
+ var $0;
+ if ($notnull_bool((this.definition instanceof TypeDefinition))) {
+ if ($notnull_bool(this.isClass)) {
+ if ($notnull_bool(this.definition.extendsTypes != null && this.definition.extendsTypes.length > 0)) {
+ if ($notnull_bool(this.definition.extendsTypes.length > 1)) {
world.error('more than one base class', this.definition.extendsTypes.$index(1).get$span());
}
var extendsTypeRef = this.definition.extendsTypes.$index(0);
- if ((extendsTypeRef instanceof GenericTypeReference)) {
+ if ($notnull_bool((extendsTypeRef instanceof GenericTypeReference))) {
var g = extendsTypeRef;
this.parent = this.resolveType(g.baseType, true);
}
- this.parent = this.resolveType(extendsTypeRef, true);
- if (!this.parent.get$isClass()) {
+ this.parent = this.resolveType((extendsTypeRef && extendsTypeRef.is$TypeReference()), true);
+ if ($notnull_bool(!this.parent.get$isClass())) {
world.error('class may not extend an interface - use implements', this.definition.extendsTypes.$index(0).get$span());
}
this.parent.addDirectSubtype(this);
- if (this._cycleInClassExtends()) {
+ if ($notnull_bool(this._cycleInClassExtends())) {
world.error(('class "' + this.name + '" has a cycle in its inheritance chain'), extendsTypeRef.get$span());
}
}
else {
- if (!this.get$isObject()) {
+ if ($notnull_bool(!this.get$isObject())) {
this.parent = world.objectType;
}
}
this.interfaces = this._resolveInterfaces(this.definition.implementsTypes);
- if (this.definition.factoryType != null) {
+ if ($notnull_bool(this.definition.factoryType != null)) {
world.error('factory not allowed on classes', this.definition.factoryType.span);
}
}
else {
- if (this.definition.implementsTypes != null && this.definition.implementsTypes.length > 0) {
+ if ($notnull_bool(this.definition.implementsTypes != null && this.definition.implementsTypes.length > 0)) {
world.error('implements not allowed on interfaces (use extends)', this.definition.implementsTypes.$index(0).get$span());
}
this.interfaces = this._resolveInterfaces(this.definition.extendsTypes);
var res = this._cycleInInterfaceExtends();
- if (res >= 0) {
+ if ($notnull_bool(res >= 0)) {
world.error(('interface "' + this.name + '" has a cycle in its inheritance chain'), this.definition.extendsTypes.$index(res).get$span());
}
- if (this.definition.factoryType != null) {
+ if ($notnull_bool(this.definition.factoryType != null)) {
this.factory_ = this.resolveType(this.definition.factoryType, true);
- if (this.factory_ == null) {
+ if ($notnull_bool(this.factory_ == null)) {
world.info(('unresolved factory: ' + this.definition.factoryType.get$name().get$name() + ''), this.definition.factoryType.get$name().get$span());
}
}
}
}
- else if ((this.definition instanceof FunctionTypeDefinition)) {
+ else if ($notnull_bool((this.definition instanceof FunctionTypeDefinition))) {
this.interfaces = [world.functionType];
}
- if (this.typeParameters != null) {
+ if ($notnull_bool(this.typeParameters != null)) {
var $list = this.typeParameters;
for (var $i = 0;$i < $list.length; $i++) {
var tp = $list.$index($i);
@@ -16327,50 +16637,50 @@ DefinedType.prototype.resolve = function() {
);
}
DefinedType.prototype.addMethod = function(methodName, definition0) {
- if (methodName == null) methodName = definition0.name.name;
+ if ($notnull_bool(methodName == null)) methodName = definition0.name.name;
var method = new MethodMember(methodName, this, definition0);
- if (method.get$isConstructor()) {
- if (this.constructors.containsKey(method.get$constructorName())) {
+ if ($notnull_bool(method.get$isConstructor())) {
+ if ($notnull_bool(this.constructors.containsKey(method.get$constructorName()))) {
world.error(('duplicate constructor definition of ' + method.get$name() + ''), definition0.span);
return;
}
this.constructors.$setindex(method.get$constructorName(), method);
return;
}
- if (definition0.modifiers != null && definition0.modifiers.length == 1 && definition0.modifiers.$index(0).kind == 74/*TokenKind.FACTORY*/) {
- if (this.factories.getFactory(method.get$constructorName(), method.get$name()) != null) {
+ if ($notnull_bool(definition0.modifiers != null && definition0.modifiers.length == 1 && definition0.modifiers.$index(0).kind == 75/*TokenKind.FACTORY*/)) {
+ if ($notnull_bool(this.factories.getFactory(method.get$constructorName(), $assert_String(method.get$name())) != null)) {
world.error(('duplicate factory definition of ' + method.get$name() + ''), definition0.span);
return;
}
- this.factories.addFactory(method.get$constructorName(), method.get$name(), method);
+ this.factories.addFactory(method.get$constructorName(), $assert_String(method.get$name()), (method && method.is$Member()));
return;
}
- if (methodName.startsWith('get\$') || methodName.startsWith('set\$')) {
+ if ($notnull_bool(methodName.startsWith('get\$') || methodName.startsWith('set\$'))) {
var propName = methodName.substring(4);
var prop = this.members.$index(propName);
- if (prop == null) {
- prop = new PropertyMember(propName, this);
+ if ($notnull_bool(prop == null)) {
+ prop = new PropertyMember($assert_String(propName), this);
this.members.$setindex(propName, prop);
}
- if (!(prop instanceof PropertyMember)) {
+ if ($notnull_bool(!(prop instanceof PropertyMember))) {
world.error(('property conflicts with field name: ' + propName + ''), definition0.span);
return;
}
- if (methodName[0] == 'g') {
- if (prop.getter != null) {
+ if ($notnull_bool(methodName[0] == 'g')) {
+ if ($notnull_bool(prop.getter != null)) {
world.error(('duplicate getter definition for ' + propName + ''), definition0.span);
}
- prop.getter = method;
+ prop.getter = (method && method.is$MethodMember());
}
else {
- if (prop.setter != null) {
+ if ($notnull_bool(prop.setter != null)) {
world.error(('duplicate setter definition for ' + propName + ''), definition0.span);
}
- prop.setter = method;
+ prop.setter = (method && method.is$MethodMember());
}
return;
}
- if (this.members.containsKey(methodName)) {
+ if ($notnull_bool(this.members.containsKey(methodName))) {
world.error(('duplicate method definition of ' + method.get$name() + ''), definition0.span);
return;
}
@@ -16378,58 +16688,58 @@ DefinedType.prototype.addMethod = function(methodName, definition0) {
}
DefinedType.prototype.addField = function(definition0) {
for (var i = 0;
- i < definition0.names.length; i++) {
+ $notnull_bool(i < definition0.names.length); i++) {
var name0 = definition0.names.$index(i).get$name();
- if (this.members.containsKey(name0)) {
+ if ($notnull_bool(this.members.containsKey(name0))) {
world.error(('duplicate field definition of ' + name0 + ''), definition0.span);
return;
}
var value = null;
- if (definition0.values != null) {
+ if ($notnull_bool(definition0.values != null)) {
value = definition0.values.$index(i);
}
- var field = new FieldMember(name0, this, definition0, value);
+ var field = new FieldMember($assert_String(name0), this, definition0, value);
this.members.$setindex(name0, field);
- if (this.isNativeType) {
+ if ($notnull_bool(this.isNativeType)) {
field.isNative = true;
}
}
}
DefinedType.prototype.getFactory = function(type, constructorName) {
var ret = this.factories.getFactory(type.name, constructorName);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
ret = this.factories.getFactory(this.name, constructorName);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
ret = this.constructors.$index(constructorName);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
return this._tryCreateDefaultConstructor(constructorName);
}
DefinedType.prototype.getConstructor = function(constructorName) {
var ret = this.constructors.$index(constructorName);
- if ($ne(ret, null)) {
- if (this.factory_ != null) {
+ if ($notnull_bool($ne(ret, null))) {
+ if ($notnull_bool(this.factory_ != null)) {
return this.factory_.getFactory(this, constructorName);
}
return ret;
}
ret = this.factories.getFactory(this.name, constructorName);
- if ($ne(ret, null)) return ret;
+ if ($notnull_bool($ne(ret, null))) return ret;
return this._tryCreateDefaultConstructor(constructorName);
}
DefinedType.prototype._tryCreateDefaultConstructor = function(name0) {
- if (name0 == '' && this.definition != null && this.isClass && this.constructors.get$length() == 0) {
+ if ($notnull_bool(name0 == '' && this.definition != null && this.isClass && this.constructors.get$length() == 0)) {
var span0 = this.definition.span;
var inits = null, body = null;
- if (this.isNativeType) {
- body = new NativeStatement(null, span0);
+ if ($notnull_bool(this.isNativeType)) {
+ body = new NativeStatement(null, (span0 && span0.is$SourceSpan()));
inits = null;
}
else {
body = null;
- inits = [new CallExpression(new SuperExpression(span0), [], span0)];
+ inits = [new CallExpression(new SuperExpression((span0 && span0.is$SourceSpan())), [], (span0 && span0.is$SourceSpan()))];
}
- var c = new FunctionDefinition(null, null, this.definition.get$name(), [], inits, body, span0);
- this.addMethod(null, c);
+ var c = new FunctionDefinition(null, null, this.definition.get$name(), [], inits, body, (span0 && span0.is$SourceSpan()));
+ this.addMethod(null, (c && c.is$FunctionDefinition()));
this.constructors.$index('').resolve(this);
return this.constructors.$index('');
}
@@ -16437,30 +16747,30 @@ DefinedType.prototype._tryCreateDefaultConstructor = function(name0) {
}
DefinedType.prototype.getMember = function(memberName) {
var member = this.members.$index(memberName);
- if (member != null) {
+ if ($notnull_bool(member != null)) {
var parentMember = this.getMemberInParents(memberName);
- if ($ne(parentMember, null)) {
- if (!member.get$isPrivate() || $eq(member.get$library(), parentMember.get$library())) {
+ if ($notnull_bool($ne(parentMember, null))) {
+ if ($notnull_bool(!member.get$isPrivate() || $eq(member.get$library(), parentMember.get$library()))) {
member.override(parentMember);
}
}
return member;
}
- if (this.get$isTop()) {
+ if ($notnull_bool(this.get$isTop())) {
var libType = this.library.findTypeByName(memberName);
- if ($ne(libType, null)) {
+ if ($notnull_bool($ne(libType, null))) {
return libType.get$typeMember();
}
}
return this.getMemberInParents(memberName);
}
DefinedType.prototype.getMemberInParents = function(memberName) {
- if (this.isClass) {
- if (this.parent != null) {
+ if ($notnull_bool(this.isClass)) {
+ if ($notnull_bool(this.parent != null)) {
return this.parent.getMember(memberName);
}
- else if (this.get$isObject()) {
- if (memberName == '\$ne') {
+ else if ($notnull_bool(this.get$isObject())) {
+ if ($notnull_bool(memberName == '\$ne')) {
var ret = this._createNotEqualMember();
this.members.$setindex(memberName, ret);
return ret;
@@ -16469,12 +16779,12 @@ DefinedType.prototype.getMemberInParents = function(memberName) {
}
}
else {
- if (this.interfaces != null && this.interfaces.length > 0) {
+ if ($notnull_bool(this.interfaces != null && this.interfaces.length > 0)) {
var $list = this.interfaces;
for (var $i = 0;$i < $list.length; $i++) {
var i = $list.$index($i);
var ret = i.getMember(memberName);
- if ($ne(ret, null)) {
+ if ($notnull_bool($ne(ret, null))) {
return ret;
}
}
@@ -16486,15 +16796,16 @@ DefinedType.prototype.getMemberInParents = function(memberName) {
}
}
DefinedType.prototype.resolveMember = function(memberName) {
+ var $0;
var ret = this._resolvedMembers.$index(memberName);
- if (ret != null) return ret;
+ if ($notnull_bool(ret != null)) return ret;
var member = this.getMember(memberName);
- if (member == null) {
+ if ($notnull_bool(member == null)) {
return null;
}
ret = new MemberSet(member);
this._resolvedMembers.$setindex(memberName, ret);
- if (member.get$isStatic()) {
+ if ($notnull_bool(member.get$isStatic())) {
return ret;
}
else {
@@ -16502,20 +16813,20 @@ DefinedType.prototype.resolveMember = function(memberName) {
for (var $i = this.get$subtypes().iterator(); $i.hasNext(); ) {
var t = $i.next();
var m;
- if (!this.isClass && t.get$isClass()) {
+ if ($notnull_bool(!this.isClass && t.get$isClass())) {
m = t.getMember(memberName);
}
else {
m = t.members.$index(memberName);
}
- if ($ne(m, null)) ret.add(m);
+ if ($notnull_bool($ne(m, null))) ret.add((m && m.is$Member()));
}
return ret;
}
}
DefinedType.prototype._createNotEqualMember = function() {
var eq = this.members.$index('\$eq');
- if (eq == null) {
+ if ($notnull_bool(eq == null)) {
world.internalError('INTERNAL: object does not define ==', this.definition.span);
}
var ne = new MethodMember('\$ne', this, eq.definition);
@@ -16527,78 +16838,79 @@ DefinedType.prototype._createNotEqualMember = function() {
return ne;
}
DefinedType._getDottedName = function(type) {
- if (type.names != null) {
+ if ($notnull_bool(type.names != null)) {
var names = map(type.names, (function (n) {
return n.get$name();
})
);
- return type.name.name + '.' + Strings.join(names, '.');
+ return type.name.name + '.' + Strings.join((names && names.is$List$String()), '.');
}
else {
return type.name.name;
}
}
DefinedType.prototype.resolveType = function(node, typeErrors) {
- if (node == null) return world.varType;
- if (node.type != null) return node.type;
- if ((node instanceof NameTypeReference)) {
+ var $0;
+ if ($notnull_bool(node == null)) return world.varType;
+ if ($notnull_bool(node.type != null)) return node.type;
+ if ($notnull_bool((node instanceof NameTypeReference))) {
var name0;
- if (node.names != null) {
- name0 = node.names.last().get$name();
+ if ($notnull_bool(node.names != null)) {
+ name0 = $assert_String(node.names.last().get$name());
}
else {
- name0 = node.get$name().get$name();
+ name0 = $assert_String(node.get$name().get$name());
}
- if (this.typeParameters != null) {
+ if ($notnull_bool(this.typeParameters != null)) {
var $list = this.typeParameters;
for (var $i = 0;$i < $list.length; $i++) {
var tp = $list.$index($i);
- if ($eq(tp.get$name(), name0)) {
- node.type = tp;
+ if ($notnull_bool($eq(tp.get$name(), name0))) {
+ node.type = (tp && tp.is$lang_Type());
}
}
}
- if (node.type == null) {
- node.type = this.library.findType(node);
+ if ($notnull_bool(node.type == null)) {
+ node.type = this.library.findType((node && node.is$NameTypeReference()));
}
- if (node.type == null) {
- var message = ('can not find type ' + DefinedType._getDottedName(node) + '');
- if (typeErrors) {
- world.error(message, node.span);
+ if ($notnull_bool(node.type == null)) {
+ var message = ('can not find type ' + DefinedType._getDottedName((node && node.is$NameTypeReference())) + '');
+ if ($notnull_bool(typeErrors)) {
+ world.error($assert_String(message), node.span);
node.type = world.objectType;
}
else {
- world.warning(message, node.span);
+ world.warning($assert_String(message), node.span);
node.type = world.varType;
}
}
}
- else if ((node instanceof GenericTypeReference)) {
+ else if ($notnull_bool((node instanceof GenericTypeReference))) {
var baseType = this.resolveType(node.baseType, typeErrors);
- if (!baseType.get$isGeneric()) {
+ if ($notnull_bool(!baseType.get$isGeneric())) {
world.error(('' + baseType.get$name() + ' is not generic'), node.span);
return null;
}
- if (node.typeArguments.length != baseType.get$typeParameters().length) {
+ if ($notnull_bool(node.typeArguments.length != baseType.get$typeParameters().length)) {
world.error('wrong number of type arguments', node.span);
return null;
}
var typeArgs = [];
for (var i = 0;
- i < node.typeArguments.length; i++) {
+ $notnull_bool(i < node.typeArguments.length); i++) {
var extendsType = baseType.get$typeParameters().$index(i).extendsType;
- var typeArg = this.resolveType(node.typeArguments.$index(i), typeErrors);
+ var typeArg = this.resolveType((($0 = node.typeArguments.$index(i)) && $0.is$TypeReference()), typeErrors);
typeArgs.add(typeArg);
- if ($ne(extendsType, null) && !(typeArg instanceof ParameterType)) {
- typeArg.ensureSubtypeOf(extendsType, node.typeArguments.$index(i).get$span(), typeErrors);
+ if ($notnull_bool($ne(extendsType, null) && !(typeArg instanceof ParameterType))) {
+ typeArg.ensureSubtypeOf((extendsType && extendsType.is$lang_Type()), node.typeArguments.$index(i).get$span(), typeErrors);
}
}
node.type = baseType.getOrMakeConcreteType(typeArgs);
}
- else if ((node instanceof FunctionTypeReference)) {
+ else if ($notnull_bool((node instanceof FunctionTypeReference))) {
var name0 = '';
- if (node.func.name != null) name0 = node.func.name.name;
- node.type = this.library.getOrAddFunctionType(name0, node.func, this);
+ if ($notnull_bool(node.func.name != null)) name0 = node.func.name.name;
+ node.type = this.library.getOrAddFunctionType($assert_String(name0), node.func, this);
}
else {
world.internalError('unknown type reference', node.span);
@@ -16609,28 +16921,30 @@ DefinedType.prototype.resolveTypeParams = function(inType) {
return this;
}
DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) {
+ $assert(this.get$isGeneric(), "isGeneric", "type.dart", 1136, 12);
var names = [this.name];
var typeMap = $map([]);
for (var i = 0;
- i < typeArgs.length; i++) {
+ $notnull_bool(i < typeArgs.length); i++) {
var paramName = this.typeParameters.$index(i).get$name();
typeMap.$setindex(paramName, typeArgs.$index(i));
names.add(typeArgs.$index(i).get$name());
}
- var concreteName = Strings.join(names, '\$');
+ var concreteName = Strings.join((names && names.is$List$String()), '\$');
var ret = this._concreteTypes.$index(concreteName);
- if (ret == null) {
- ret = new ConcreteType(concreteName, this, typeMap, typeArgs);
+ if ($notnull_bool(ret == null)) {
+ ret = new ConcreteType($assert_String(concreteName), this, typeMap, typeArgs);
this._concreteTypes.$setindex(concreteName, ret);
}
return ret;
}
DefinedType.prototype.getCallStub = function(args) {
+ $assert(this.get$isFunction(), "isFunction", "type.dart", 1156, 12);
var name0 = _getCallStubName('call', args);
- if (this.varStubs == null) this.varStubs = $map([]);
+ if ($notnull_bool(this.varStubs == null)) this.varStubs = $map([]);
var stub = this.varStubs.$index(name0);
- if (stub == null) {
- stub = new VarFunctionStub(name0, args);
+ if ($notnull_bool(stub == null)) {
+ stub = new VarFunctionStub($assert_String(name0), args);
this.varStubs.$setindex(name0, stub);
}
return stub;
@@ -16641,6 +16955,7 @@ function FixedCollection(value, length) {
this.length = length;
// Initializers done
}
+FixedCollection.prototype.is$Iterable = function(){return this;};
FixedCollection.prototype.get$value = function() { return this.value; };
FixedCollection.prototype.iterator = function() {
return new FixedIterator$E(this.value, this.length);
@@ -16665,6 +16980,7 @@ function FixedCollection$Type(value, length) {
// Initializers done
}
$inherits(FixedCollection$Type, FixedCollection);
+FixedCollection$Type.prototype.is$Iterable = function(){return this;};
// ********** Code for FixedIterator **************
function FixedIterator(value, length) {
this._index = 0
@@ -16696,17 +17012,18 @@ function Value(type, code, isSuper, needsTemp, isType) {
this.needsTemp = needsTemp;
this.isType = isType;
// Initializers done
- if (this.type == null) this.type = world.varType;
+ if ($notnull_bool(this.type == null)) this.type = world.varType;
}
+Value.prototype.is$Value = function(){return this;};
Value.prototype.get$isConst = function() {
return false;
}
Value.prototype.get_ = function(context, name, node) {
var member = this._resolveMember(context, name, node);
- if ($ne(member, null)) {
+ if ($notnull_bool($ne(member, null))) {
member = member.get_$3(context, node, this);
}
- if ($ne(member, null)) {
+ if ($notnull_bool($ne(member, null))) {
return member;
}
else {
@@ -16715,10 +17032,10 @@ Value.prototype.get_ = function(context, name, node) {
}
Value.prototype.set_ = function(context, name, node, value, isDynamic) {
var member = this._resolveMember(context, name, node);
- if ($ne(member, null)) {
+ if ($notnull_bool($ne(member, null))) {
member = member.set_(context, node, this, value, isDynamic);
}
- if ($ne(member, null)) {
+ if ($notnull_bool($ne(member, null))) {
return member;
}
else {
@@ -16726,22 +17043,22 @@ Value.prototype.set_ = function(context, name, node, value, isDynamic) {
}
}
Value.prototype.invoke = function(context, name, node, args, isDynamic) {
- if (this.type.get$isVar() && name == '\$ne') {
- if (args.values.length != 1) {
+ if ($notnull_bool(this.type.get$isVar() && name == '\$ne')) {
+ if ($notnull_bool(args.values.length != 1)) {
world.warning('wrong number of arguments for !=', node.span);
}
return new Value(null, ('\$ne(' + this.code + ', ' + args.values.$index(0).code + ')'), false, true, false);
}
- if (name == '\$call') {
- if (this.isType) {
+ if ($notnull_bool(name == '\$call')) {
+ if ($notnull_bool(this.isType)) {
world.error('must use "new" or "const" to construct a new instance', node.span);
}
- if (this.type.needsVarCall(args)) {
+ if ($notnull_bool(this.type.needsVarCall(args))) {
return this._varCall(context, args);
}
}
var member = this._resolveMember(context, name, node);
- if (member == null) {
+ if ($notnull_bool(member == null)) {
return this.invokeNoSuchMethod(context, name, node, args);
}
else {
@@ -16749,10 +17066,10 @@ Value.prototype.invoke = function(context, name, node, args, isDynamic) {
}
}
Value.prototype.canInvoke = function(context, name, args) {
- if (this.type.get$isVar() && name == '\$ne') {
+ if ($notnull_bool(this.type.get$isVar() && name == '\$ne')) {
return true;
}
- if (this.type.get$isVarOrFunction() && name == '\$call') {
+ if ($notnull_bool(this.type.get$isVarOrFunction() && name == '\$call')) {
return true;
}
var member = this._tryResolveMember(context, name);
@@ -16760,41 +17077,41 @@ Value.prototype.canInvoke = function(context, name, args) {
}
Value.prototype._tryResolveMember = function(context, name) {
var member = null;
- if (!this.type.get$isVar()) {
- if (this.isSuper) {
+ if ($notnull_bool(!this.type.get$isVar())) {
+ if ($notnull_bool(this.isSuper)) {
return this.type.getMember(name);
}
else {
member = this.type.resolveMember(name);
}
}
- if (member == null) {
+ if ($notnull_bool(member == null)) {
member = context.findMembers(name);
}
return member;
}
Value.prototype._resolveMember = function(context, name, node) {
var member = this._tryResolveMember(context, name);
- if (member == null) {
- if (this._tryResolveMember(context, 'noSuchMethod').members.length > 1) {
+ if ($notnull_bool(member == null)) {
+ if ($notnull_bool(this._tryResolveMember(context, 'noSuchMethod').members.length > 1)) {
return null;
}
- var typeName = this.type.name == null ? this.type.get$library().name : this.type.name;
+ var typeName = $notnull_bool(this.type.name == null) ? this.type.get$library().name : this.type.name;
var message = ('can not resolve "' + name + '" on "' + typeName + '"');
- if (this.isType) {
- world.error(message, node.span);
+ if ($notnull_bool(this.isType)) {
+ world.error($assert_String(message), node.span);
}
else {
- world.warning(message, node.span);
+ world.warning($assert_String(message), node.span);
}
- if (context.findMembers(name) == null) {
+ if ($notnull_bool(context.findMembers(name) == null)) {
world.warning(('' + name + ' is not defined anywhere in the world.'), node.span);
}
}
return member;
}
Value.prototype.checkFirstClass = function(span) {
- if (this.isType) {
+ if ($notnull_bool(this.isType)) {
world.error('Types are not first class', span);
}
}
@@ -16802,93 +17119,130 @@ Value.prototype._varCall = function(context, args) {
var stub = world.functionType.getCallStub(args);
return new Value(null, ('' + this.code + '.' + stub.get$name() + '(' + args.getCode() + ')'), false, true, false);
}
+Value.prototype.needsConversion = function(toType) {
+ var callMethod = toType.getCallMethod();
+ if ($notnull_bool($ne(callMethod, null))) {
+ var arity = callMethod.get$parameters().length;
+ var myCall = this.type.getCallMethod();
+ if ($notnull_bool(myCall == null || myCall.get$parameters().length != arity)) {
+ return true;
+ }
+ }
+ if ($notnull_bool(options.enableTypeChecks)) {
+ var fromType = this.type;
+ if ($notnull_bool(this.type.get$isVar() && this.code != 'null')) {
+ fromType = world.objectType;
+ }
+ var bothNum = this.type.get$isNum() && toType.get$isNum();
+ return fromType.isSubtypeOf(toType) || bothNum;
+ }
+ return false;
+}
Value.prototype.convertTo = function(context, toType, node, isDynamic) {
- var checked = options.enableTypeChecks && !isDynamic;
+ var checked = !isDynamic;
var callMethod = toType.getCallMethod();
- if ($ne(callMethod, null)) {
- if (checked && !toType.isAssignable(this.type)) {
+ if ($notnull_bool($ne(callMethod, null))) {
+ if ($notnull_bool(checked && !toType.isAssignable(this.type))) {
this.convertWarning(toType, node);
}
var arity = callMethod.get$parameters().length;
var myCall = this.type.getCallMethod();
- if (myCall == null || myCall.get$parameters().length != arity) {
+ if ($notnull_bool(myCall == null || myCall.get$parameters().length != arity)) {
var stub = world.functionType.getCallStub(Arguments.Arguments$bare$factory(arity));
return new Value(toType, ('to\$' + stub.name + '(' + this.code + ')'), false, true, false);
}
}
- if (!options.enableTypeChecks) {
+ if ($notnull_bool(!options.enableTypeChecks)) {
return this;
}
- if (this.type.isSubtypeOf(toType)) {
+ var fromType = this.type;
+ if ($notnull_bool(this.type.get$isVar() && this.code != 'null')) {
+ fromType = world.objectType;
+ }
+ var bothNum = this.type.get$isNum() && toType.get$isNum();
+ if ($notnull_bool(!checked || fromType.isSubtypeOf(toType) || bothNum)) {
return this;
}
- else if (checked && !toType.isSubtypeOf(this.type)) {
+ if ($notnull_bool(!toType.isSubtypeOf(this.type))) {
this.convertWarning(toType, node);
}
return this._typeAssert(context, toType, node);
}
+Value.prototype.convertToNonNullBool = function(context, node) {
+ if ($notnull_bool(!this.type.isAssignable(world.boolType))) {
+ this.convertWarning(world.boolType, node);
+ }
+ if ($notnull_bool(!options.enableTypeChecks)) {
+ return this;
+ }
+ else {
+ if ($notnull_bool(this.code.startsWith('\$notnull_bool'))) {
+ return this;
+ }
+ else {
+ return new Value(world.boolType, ('\$notnull_bool(' + this.code + ')'), false, true, false);
+ }
+ }
+}
Value.prototype._typeAssert = function(context, toType, node) {
- if ((toType instanceof ParameterType)) {
+ if ($notnull_bool((toType instanceof ParameterType))) {
var p = toType;
toType = p.extendsType;
}
- var temp = context.getTemp(this);
- var testCode;
- if (toType.get$library().get$isCore() && toType.get$typeofName() != null) {
- testCode = ("typeof(" + temp.code + ") == '" + toType.get$typeofName() + "'");
+ if ($notnull_bool(toType.get$isObject() || toType.get$isVar())) {
+ world.internalError(('We thought ' + this.type.name + ' is not a subtype of ' + toType.name + '?'));
}
- else if (toType.get$isClass() && !(toType instanceof ConcreteType)) {
- toType.markUsed();
- testCode = ('' + temp.code + ' instanceof ' + toType.get$jsname() + '');
+ if ($notnull_bool(toType.get$isNum())) toType = world.numType;
+ var check;
+ if ($notnull_bool(toType.get$library().get$isCore() && toType.get$typeofName() != null)) {
+ check = ('\$assert_' + toType.name + '(' + this.code + ')');
+ if ($notnull_bool(toType.typeCheckCode == null)) {
+ toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if (x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n throw new TypeError(\"'\" + x + \"' is not a " + toType.name + ".\");\n}");
+ }
}
else {
toType.isTested = true;
- testCode = ('' + temp.code + '.is\$' + toType.get$jsname() + '');
- }
- testCode = ('(' + context.assignTemp(temp, this).code + ' == null || ' + testCode + ')');
- var test = new Value(world.boolType, testCode, false, true, false);
- var err = world.corelib.types.$index('TypeError');
- world.gen.genMethod(err.members.$index('toString'));
- var args = new Arguments(null, [temp, new Value(world.stringType, ('"' + toType.name + '"'), false, true, false)]);
- var typeErr = err.getConstructor('').invoke$4(context, node, null, args);
- var result = new Value(toType, ('(' + test.code + ' ? ' + temp.code + ' : ') + ('\$throw(' + typeErr.code + '))'), false, true, false);
- if ($ne(temp, this)) context.freeTemp(temp);
- return result;
+ var temp = context.getTemp(this);
+ check = ('(' + context.assignTemp((temp && temp.is$Value()), this).code + ' &&');
+ check = check + (' ' + temp.code + '.is\$' + toType.get$jsname() + '())');
+ if ($notnull_bool($ne(this, temp))) context.freeTemp((temp && temp.is$Value()));
+ }
+ return new Value(toType, check, false, true, false);
}
Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck) {
- if (toType.get$isVar()) {
+ if ($notnull_bool(toType.get$isVar())) {
world.error('can not resolve type', span);
return EvaluatedValue.EvaluatedValue$factory(world.boolType, true, 'true', null);
}
- if ((toType instanceof ParameterType)) {
+ if ($notnull_bool((toType instanceof ParameterType))) {
return EvaluatedValue.EvaluatedValue$factory(world.boolType, true, 'true', null);
}
var testCode = null;
- if (toType.get$library().get$isCore()) {
+ if ($notnull_bool(toType.get$library().get$isCore())) {
var typeofName = toType.get$typeofName();
- if ($ne(typeofName, null)) {
- testCode = ("(typeof(" + this.code + ") " + (isTrue ? '==' : '!=') + " '" + typeofName + "')");
+ if ($notnull_bool($ne(typeofName, null))) {
+ testCode = ("(typeof(" + this.code + ") " + ($notnull_bool(isTrue) ? '==' : '!=') + " '" + typeofName + "')");
}
}
- if (toType.get$isClass() && !(toType instanceof ConcreteType)) {
+ if ($notnull_bool(toType.get$isClass() && !(toType instanceof ConcreteType))) {
toType.markUsed();
testCode = ('(' + this.code + ' instanceof ' + toType.get$jsname() + ')');
- if (!isTrue) {
+ if ($notnull_bool(!isTrue)) {
testCode = '!' + testCode;
}
}
- if (testCode == null) {
+ if ($notnull_bool(testCode == null)) {
toType.isTested = true;
var temp = context.getTemp(this);
- testCode = ('(' + context.assignTemp(temp, this).code + ' &&');
+ testCode = ('(' + context.assignTemp((temp && temp.is$Value()), this).code + ' &&');
testCode = testCode + (' ' + temp.code + '.is\$' + toType.get$jsname() + ')');
- if (isTrue) {
+ if ($notnull_bool(isTrue)) {
testCode = '!!' + testCode;
}
else {
testCode = '!' + testCode;
}
- if ($ne(this, temp)) context.freeTemp(temp);
+ if ($notnull_bool($ne(this, temp))) context.freeTemp((temp && temp.is$Value()));
}
return new Value(world.boolType, testCode, false, true, false);
}
@@ -16897,34 +17251,39 @@ Value.prototype.convertWarning = function(toType, node) {
}
Value.prototype.invokeNoSuchMethod = function(context, name, node, args) {
var pos = '';
- if (args != null) {
+ if ($notnull_bool(args != null)) {
var argsCode = [];
for (var i = 0;
- i < args.get$length(); i++) {
+ $notnull_bool(i < args.get$length()); i++) {
argsCode.add(args.values.$index(i).code);
}
- pos = Strings.join(argsCode, ", ");
+ pos = Strings.join((argsCode && argsCode.is$List$String()), ", ");
}
var noSuchArgs = [new Value(world.stringType, ('"' + name + '"'), false, true, false), new Value(world.listType, ('[' + pos + ']'), false, true, false)];
return this._tryResolveMember(context, 'noSuchMethod').invoke$4(context, node, this, new Arguments(null, noSuchArgs));
}
Value.prototype.invokeSpecial = function(name, args, returnType) {
+ $assert(name.startsWith('\$'), "name.startsWith('\\$')", "value.dart", 410, 12);
+ $assert(!args.get$hasNames(), "!args.hasNames", "value.dart", 411, 12);
var argsString = args.getCode();
- if (name == '\$index' || name == '\$setindex') {
+ if ($notnull_bool(name == '\$index' || name == '\$setindex')) {
return new Value(returnType, ('' + this.code + '.' + name + '(' + argsString + ')'), false, true, false);
}
else {
- if (argsString.length > 0) argsString = (', ' + argsString + '');
+ if ($notnull_bool(argsString.length > 0)) argsString = (', ' + argsString + '');
return new Value(returnType, ('' + name + '(' + this.code + '' + argsString + ')'), false, true, false);
}
}
-Value.prototype.get_$3 = Value.prototype.get_;
+Value.prototype.get_$3 = function($0, $1, $2) {
+ return this.get_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()));
+}
+;
Value.prototype.invoke$4 = function($0, $1, $2, $3) {
- return this.invoke($0, $1, $2, $3, false);
+ return this.invoke(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Arguments()), false);
}
;
Value.prototype.set_$4 = function($0, $1, $2, $3) {
- return this.set_($0, $1, $2, $3, false);
+ return this.set_(($0 && $0.is$MethodGenerator()), $assert_String($1), ($2 && $2.is$lang_Node()), ($3 && $3.is$Value()), false);
}
;
// ********** Code for EvaluatedValue **************
@@ -16939,7 +17298,7 @@ EvaluatedValue._internal$ctor = function(type0, actualValue, canonicalCode, orig
EvaluatedValue._internal$ctor.prototype = EvaluatedValue.prototype;
$inherits(EvaluatedValue, Value);
EvaluatedValue.EvaluatedValue$factory = function(type0, actualValue0, canonicalCode0, original0) {
- return new EvaluatedValue._internal$ctor(type0, actualValue0, canonicalCode0, original0, EvaluatedValue.codeWithComments(canonicalCode0, original0));
+ return new EvaluatedValue._internal$ctor(type0, actualValue0, canonicalCode0, original0, EvaluatedValue.codeWithComments($assert_String(canonicalCode0), (original0 && original0.is$SourceSpan())));
}
EvaluatedValue.prototype.get$actualValue = function() { return this.actualValue; };
EvaluatedValue.prototype.set$actualValue = function(value) { return this.actualValue = value; };
@@ -16947,7 +17306,7 @@ EvaluatedValue.prototype.get$isConst = function() {
return true;
}
EvaluatedValue.codeWithComments = function(canonicalCode0, original0) {
- return (original0 != null && original0.get$text() != canonicalCode0) ? ('' + canonicalCode0 + '/*' + original0.get$text() + '*/') : canonicalCode0;
+ return $notnull_bool((original0 != null && original0.get$text() != canonicalCode0)) ? ('' + canonicalCode0 + '/*' + original0.get$text() + '*/') : canonicalCode0;
}
// ********** Code for ConstListValue **************
function ConstListValue() {}
@@ -16973,7 +17332,7 @@ $inherits(ConstMapValue, EvaluatedValue);
ConstMapValue.ConstMapValue$factory = function(type0, keyValuePairs, actualValue0, canonicalCode0, original0) {
var values0 = new HashMapImplementation$String$EvaluatedValue();
for (var i = 0;
- i < keyValuePairs.length; i += 2) {
+ $notnull_bool(i < keyValuePairs.length); i += 2) {
values0.$setindex(keyValuePairs.$index(i).get$actualValue(), keyValuePairs.$index(i + 1));
}
return new ConstMapValue._internal$ctor(type0, values0, actualValue0, canonicalCode0, original0, EvaluatedValue.codeWithComments(canonicalCode0, original0));
@@ -16988,6 +17347,7 @@ ConstObjectValue._internal$ctor = function(type0, fields, actualValue0, canonica
ConstObjectValue._internal$ctor.prototype = ConstObjectValue.prototype;
$inherits(ConstObjectValue, EvaluatedValue);
ConstObjectValue.ConstObjectValue$factory = function(type0, fields0, canonicalCode0, original0) {
+ var $0;
var fieldValues = [];
var $list = fields0.getKeys();
for (var $i = fields0.getKeys().iterator(); $i.hasNext(); ) {
@@ -17014,7 +17374,7 @@ function GlobalValue(type0, code0, isConst0, field, name, exp, canonicalCode, or
}
$inherits(GlobalValue, Value);
GlobalValue.GlobalValue$fromStatic$factory = function(field0, exp0, dependencies0) {
- var code0 = (exp0.get$isConst() ? exp0.canonicalCode : exp0.code);
+ var code0 = ($notnull_bool(exp0.get$isConst()) ? exp0.canonicalCode : exp0.code);
var codeWithComment = ('' + code0 + '/*' + field0.declaringType.name + '.' + field0.get$name() + '*/');
return new GlobalValue(exp0.type, codeWithComment, field0.isFinal, field0, null, exp0, code0, null, dependencies0.filter((function (d) {
return (d instanceof GlobalValue);
@@ -17038,28 +17398,28 @@ GlobalValue.prototype.get$actualValue = function() {
return this.exp.get$dynamic().get$actualValue();
}
GlobalValue.prototype.compareTo = function(other) {
- if ($eq(other, this)) {
+ if ($notnull_bool($eq(other, this))) {
return 0;
}
- else if (this.dependencies.indexOf(other, 0) >= 0) {
+ else if ($notnull_bool(this.dependencies.indexOf(other, 0) >= 0)) {
return 1;
}
- else if (other.dependencies.indexOf(this, 0) >= 0) {
+ else if ($notnull_bool(other.dependencies.indexOf(this, 0) >= 0)) {
return -1;
}
- else if (this.dependencies.length > other.dependencies.length) {
+ else if ($notnull_bool(this.dependencies.length > other.dependencies.length)) {
return 1;
}
- else if (this.dependencies.length < other.dependencies.length) {
+ else if ($notnull_bool(this.dependencies.length < other.dependencies.length)) {
return -1;
}
- else if (this.name == null && other.name != null) {
+ else if ($notnull_bool(this.name == null && other.name != null)) {
return 1;
}
- else if (this.name != null && other.name == null) {
+ else if ($notnull_bool(this.name != null && other.name == null)) {
return -1;
}
- else if (this.name != null) {
+ else if ($notnull_bool(this.name != null)) {
return this.name.compareTo(other.name);
}
else {
@@ -17073,7 +17433,7 @@ function CompilerException(_message, _location) {
// Initializers done
}
CompilerException.prototype.toString = function() {
- if (this._location != null) {
+ if ($notnull_bool(this._location != null)) {
return ('CompilerException: ' + this._location.toMessageString(this._lang_message) + '');
}
else {
@@ -17104,29 +17464,33 @@ World.prototype.get$dom = function() {
World.prototype.get$functionType = function() { return this.functionType; };
World.prototype.set$functionType = function(value) { return this.functionType = value; };
World.prototype.init = function() {
+ var $0;
this.corelib = new Library(this.readFile('dart:core'));
this.libraries.$setindex('dart:core', this.corelib);
this._todo.add(this.corelib);
- this.voidType = this._addToCoreLib('void', false);
- this.dynamicType = this._addToCoreLib('Dynamic', false);
+ this.voidType = (($0 = this._addToCoreLib('void', false)) && $0.is$lang_Type());
+ this.dynamicType = (($0 = this._addToCoreLib('Dynamic', false)) && $0.is$lang_Type());
this.varType = this.dynamicType;
- this.objectType = this._addToCoreLib('Object', true);
- this.numType = this._addToCoreLib('num', false);
- this.boolType = this._addToCoreLib('bool', false);
- this.stringType = this._addToCoreLib('String', false);
- this.listType = this._addToCoreLib('List', false);
- this.mapType = this._addToCoreLib('Map', false);
- this.functionType = this._addToCoreLib('Function', false);
+ this.objectType = (($0 = this._addToCoreLib('Object', true)) && $0.is$lang_Type());
+ this.numType = (($0 = this._addToCoreLib('num', false)) && $0.is$lang_Type());
+ this.intType = (($0 = this._addToCoreLib('int', false)) && $0.is$lang_Type());
+ this.doubleType = (($0 = this._addToCoreLib('double', false)) && $0.is$lang_Type());
+ this.boolType = (($0 = this._addToCoreLib('bool', false)) && $0.is$lang_Type());
+ this.stringType = (($0 = this._addToCoreLib('String', false)) && $0.is$lang_Type());
+ this.listType = (($0 = this._addToCoreLib('List', false)) && $0.is$lang_Type());
+ this.mapType = (($0 = this._addToCoreLib('Map', false)) && $0.is$lang_Type());
+ this.functionType = (($0 = this._addToCoreLib('Function', false)) && $0.is$lang_Type());
}
World.prototype._addMember = function(member) {
- if (member.get$isStatic()) {
- if (member.declaringType.get$isTop()) {
+ $assert(!member.get$isPrivate(), "!member.isPrivate", "world.dart", 141, 12);
+ if ($notnull_bool(member.get$isStatic())) {
+ if ($notnull_bool(member.declaringType.get$isTop())) {
this._addTopName(member);
}
return;
}
var mset = this._members.$index(member.name);
- if (mset == null) {
+ if ($notnull_bool(mset == null)) {
mset = new MemberSet(member);
this._members.$setindex(mset.get$name(), mset);
}
@@ -17136,24 +17500,24 @@ World.prototype._addMember = function(member) {
}
World.prototype._addTopName = function(named) {
var existing = this._topNames.$index(named.get$name());
- if ($ne(existing, null)) {
+ 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 + '"'));
- if (named.get$isNative()) {
- if (existing.get$isNative()) {
+ 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());
}
else {
this._topNames.$setindex(named.get$name(), named);
- this._addJavascriptTopName(existing);
+ this._addJavascriptTopName((existing && existing.is$Named()));
}
}
- else if (named.get$library().get$isCore()) {
- if (existing.get$library().get$isCore()) {
+ 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());
}
else {
this._topNames.$setindex(named.get$name(), named);
- this._addJavascriptTopName(existing);
+ this._addJavascriptTopName((existing && existing.is$Named()));
}
}
else {
@@ -17167,13 +17531,13 @@ World.prototype._addTopName = function(named) {
World.prototype._addJavascriptTopName = function(named) {
named.set$jsname(('' + named.get$library().get$jsname() + '_' + named.get$name() + ''));
var existing = this._topNames.$index(named.get$jsname());
- if ($ne(existing, null) && $ne(existing, named)) {
+ 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());
}
this._topNames.$setindex(named.get$jsname(), named);
}
World.prototype._addType = function(type) {
- if (!type.get$isTop()) this._addTopName(type);
+ if ($notnull_bool(!type.get$isTop())) this._addTopName(type);
}
World.prototype._addToCoreLib = function(name, isClass) {
var ret = new DefinedType(name, this.corelib, null, isClass);
@@ -17181,10 +17545,10 @@ World.prototype._addToCoreLib = function(name, isClass) {
return ret;
}
World.prototype.toJsIdentifier = function(name) {
- if (this._jsKeywords == null) {
+ if ($notnull_bool(this._jsKeywords == null)) {
this._jsKeywords = HashSetImplementation.HashSetImplementation$from$factory(['break', 'case', 'catch', 'continue', 'debugger', 'default', 'delete', 'do', 'else', 'finally', 'for', 'function', 'if', 'in', 'instanceof', 'new', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'var', 'void', 'while', 'with', 'class', 'enum', 'export', 'extends', 'import', 'super', 'implements', 'interface', 'let', 'package', 'private', 'protected', 'public', 'static', 'yield', 'native']);
}
- if (this._jsKeywords.contains(name)) {
+ if ($notnull_bool(this._jsKeywords.contains(name))) {
return name + '_';
}
else {
@@ -17192,16 +17556,16 @@ World.prototype.toJsIdentifier = function(name) {
}
}
World.prototype.compile = function() {
- if (options.dartScript == null) {
+ if ($notnull_bool(options.dartScript == null)) {
this.fatal('no script provided to compile');
return false;
}
try {
this.info(('compiling ' + options.dartScript + ' with corelib ' + this.corelib + ''));
- if (!this.runLeg()) this.runCompilationPhases();
+ if ($notnull_bool(!this.runLeg())) this.runCompilationPhases();
} catch (exc) {
exc = $toDartException(exc);
- if (this.get$hasErrors() && !options.throwOnErrors) {
+ if ($notnull_bool(this.get$hasErrors() && !options.throwOnErrors)) {
}
else {
throw exc;
@@ -17212,12 +17576,12 @@ World.prototype.compile = function() {
}
World.prototype.runLeg = function() {
var $this = this; // closure support
- if (!options.enableLeg) return false;
+ if ($notnull_bool(!options.enableLeg)) return false;
var res = this.withTiming('try leg compile', (function () {
return compile($this);
})
);
- if (!res && options.legOnly) {
+ if ($notnull_bool(!res && options.legOnly)) {
this.fatal(("Leg could not compile " + options.dartScript + ""));
}
return res;
@@ -17233,12 +17597,13 @@ World.prototype.runCompilationPhases = function() {
})
);
this.withTiming('generate code', (function () {
+ var $0;
var mainMembers = lib.topType.resolveMember('main');
var main = null;
- if (mainMembers == null || mainMembers.members.length == 0) {
+ if ($notnull_bool(mainMembers == null || mainMembers.members.length == 0)) {
$this.fatal('no main method specified');
}
- else if (mainMembers.members.length > 1) {
+ else if ($notnull_bool(mainMembers.members.length > 1)) {
var $list = mainMembers.members;
for (var $i = mainMembers.members.iterator(); $i.hasNext(); ) {
var m = $i.next();
@@ -17257,7 +17622,8 @@ World.prototype.runCompilationPhases = function() {
);
}
World.prototype.getGeneratedCode = function() {
- if (this.legCode != null) {
+ if ($notnull_bool(this.legCode != null)) {
+ $assert(options.enableLeg, "options.enableLeg", "world.dart", 304, 14);
return this.legCode;
}
else {
@@ -17277,10 +17643,10 @@ World.prototype.readFile = function(filename) {
}
World.prototype.getOrAddLibrary = function(filename) {
var library = this.libraries.$index(filename);
- if (library == null) {
+ if ($notnull_bool(library == null)) {
library = new Library(this.readFile(filename));
this.info(('read library ' + filename + ''));
- if (!library.get$isCore()) {
+ if ($notnull_bool(!library.get$isCore())) {
library.imports.add(new LibraryImport(this.corelib));
}
this.libraries.$setindex(filename, library);
@@ -17289,7 +17655,7 @@ World.prototype.getOrAddLibrary = function(filename) {
return library;
}
World.prototype.process = function() {
- while (this._todo.length > 0) {
+ while ($notnull_bool(this._todo.length > 0)) {
var todo = this._todo;
this._todo = [];
for (var $i = 0;$i < todo.length; $i++) {
@@ -17304,6 +17670,7 @@ World.prototype.processScript = function(filename) {
return library;
}
World.prototype.resolveAll = function() {
+ var $0;
var $list = this.libraries.getValues();
for (var $i = this.libraries.getValues().iterator(); $i.hasNext(); ) {
var lib = $i.next();
@@ -17312,14 +17679,14 @@ World.prototype.resolveAll = function() {
}
World.prototype._message = function(message, span, span1, throwing) {
var text = message;
- if (span != null) {
+ if ($notnull_bool(span != null)) {
text = span.toMessageString(message);
}
print(text);
- if (span1 != null) {
+ if ($notnull_bool(span1 != null)) {
print(span1.toMessageString(message));
}
- if (throwing) {
+ if ($notnull_bool(throwing)) {
$throw(new CompilerException(message, span));
}
}
@@ -17329,20 +17696,20 @@ World.prototype.error = function(message, span, span1) {
}
World.prototype.warning = function(message, span, span1) {
this.warnings++;
- if (options.showWarnings) {
+ if ($notnull_bool(options.showWarnings)) {
this._message(('warning: ' + message + ''), span, span1, options.throwOnWarnings);
}
}
World.prototype.fatal = function(message, span, span1) {
this.errors++;
this.seenFatal = true;
- this._message(('fatal: ' + message + ''), span, span1, options.throwOnFatal || options.throwOnErrors);
+ this._message(('fatal: ' + message + ''), span, span1, $assert_bool(options.throwOnFatal || options.throwOnErrors));
}
World.prototype.internalError = function(message, span, span1) {
this._message(('We are sorry, but... ' + message + ''), span, span1, true);
}
World.prototype.info = function(message, span, span1) {
- if (options.showInfo) {
+ if ($notnull_bool(options.showInfo)) {
this._message(('info: ' + message + ''), span, span1, false);
}
}
@@ -17351,11 +17718,11 @@ World.prototype.get$hasErrors = function() {
}
World.prototype.printStatus = function() {
this.info(('compiled ' + this.dartBytesRead + ' bytes Dart -> ' + this.jsBytesWritten + ' bytes JS'));
- if (this.get$hasErrors()) {
+ if ($notnull_bool(this.get$hasErrors())) {
print(('compilation failed with ' + this.errors + ' errors'));
}
else {
- if (this.warnings > 0) {
+ if ($notnull_bool(this.warnings > 0)) {
this.info(('compilation completed successfully with ' + this.warnings + ' warnings'));
}
else {
@@ -17373,6 +17740,7 @@ World.prototype.withTiming = function(name, f) {
}
// ********** Code for FrogOptions **************
function FrogOptions(homedir, args, files) {
+ var $0;
this.enableLeg = false
this.legOnly = false
this.enableAsserts = false
@@ -17393,7 +17761,7 @@ function FrogOptions(homedir, args, files) {
this.childArgs = [];
loop:
for (var i = 2;
- i < args.length; i++) {
+ $notnull_bool(i < args.length); i++) {
var arg = args.$index(i);
switch (arg) {
case '--enable_leg':
@@ -17460,30 +17828,30 @@ function FrogOptions(homedir, args, files) {
default:
- if (arg.endsWith('.dart')) {
- this.dartScript = arg;
- this.childArgs = args.getRange(i + 1, args.length - i - 1);
+ if ($notnull_bool(arg.endsWith('.dart'))) {
+ this.dartScript = $assert_String(arg);
+ this.childArgs = (($0 = args.getRange(i + 1, args.length - i - 1)) && $0.is$List$String());
break loop;
}
- else if (arg.startsWith('--out=')) {
+ else if ($notnull_bool(arg.startsWith('--out='))) {
this.outfile = arg.substring('--out='.length);
}
- else if (arg.startsWith('--libdir=')) {
+ else if ($notnull_bool(arg.startsWith('--libdir='))) {
this.libDir = arg.substring('--libdir='.length);
passedLibDir = true;
}
else {
- if (!ignoreUnrecognizedFlags) {
+ if ($notnull_bool(!ignoreUnrecognizedFlags)) {
print(('unrecognized flag: "' + arg + '"'));
}
}
}
}
- if (!passedLibDir && !files.fileExists(this.libDir)) {
+ if ($notnull_bool(!passedLibDir && !files.fileExists(this.libDir))) {
var temp = 'frog/lib';
- if (files.fileExists(temp)) {
- this.libDir = temp;
+ if ($notnull_bool(files.fileExists(temp))) {
+ this.libDir = $assert_String(temp);
}
else {
this.libDir = 'lib';
@@ -17497,10 +17865,10 @@ function LibraryReader() {
}
LibraryReader.prototype.readFile = function(fullname) {
var filename = this._specialLibs.$index(fullname);
- if (filename == null) {
+ if ($notnull_bool(filename == null)) {
filename = fullname;
}
- if (world.files.fileExists(filename)) {
+ if ($notnull_bool(world.files.fileExists(filename))) {
return new SourceFile(filename, world.files.readAll(filename));
}
else {
@@ -17513,6 +17881,7 @@ function VarMember(name) {
this.name = name;
// Initializers done
}
+VarMember.prototype.is$VarMember = function(){return this;};
VarMember.prototype.get$name = function() { return this.name; };
VarMember.prototype.get$returnType = function() {
return world.varType;
@@ -17520,7 +17889,10 @@ VarMember.prototype.get$returnType = function() {
VarMember.prototype.invoke = function(context, node, target, args) {
return new Value(this.get$returnType(), ('' + target.code + '.' + this.name + '(' + args.getCode() + ')'), false, true, false);
}
-VarMember.prototype.invoke$4 = VarMember.prototype.invoke;
+VarMember.prototype.invoke$4 = function($0, $1, $2, $3) {
+ return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()));
+}
+;
// ********** Code for VarFunctionStub **************
function VarFunctionStub(name0, callArgs) {
this.args = callArgs.toCallStubArgs();
@@ -17529,7 +17901,7 @@ function VarFunctionStub(name0, callArgs) {
}
$inherits(VarFunctionStub, VarMember);
VarFunctionStub.prototype.generate = function(code) {
- if (this.args.get$hasNames()) {
+ if ($notnull_bool(this.args.get$hasNames())) {
this.generateNamed(code);
}
else {
@@ -17567,10 +17939,10 @@ function VarMethodStub(name0, member, args, body) {
}
$inherits(VarMethodStub, VarMember);
VarMethodStub.prototype.get$returnType = function() {
- return this.member != null ? this.member.get$returnType() : world.varType;
+ return $notnull_bool(this.member != null) ? this.member.get$returnType() : world.varType;
}
VarMethodStub.prototype.get$typeName = function() {
- return this.member != null ? this.member.declaringType.get$jsname() : 'Object';
+ return $notnull_bool(this.member != null) ? this.member.declaringType.get$jsname() : 'Object';
}
VarMethodStub.prototype.generate = function(code) {
code.write(('' + this.get$typeName() + '.prototype.' + this.name + ' = '));
@@ -17578,7 +17950,7 @@ VarMethodStub.prototype.generate = function(code) {
code.writeln(';');
}
VarMethodStub.prototype.generateBody = function(code) {
- if (this._useDirectCall(this.member, this.args)) {
+ if ($notnull_bool(this._useDirectCall(this.member, this.args))) {
code.write(('' + this.get$typeName() + '.prototype.' + this.member.get$jsname() + ''));
}
else {
@@ -17588,12 +17960,14 @@ VarMethodStub.prototype.generateBody = function(code) {
}
}
VarMethodStub.prototype._useDirectCall = function(member0, args0) {
- if ((member0 instanceof MethodMember) && $ne(member0.declaringType.get$library(), world.get$dom())) {
+ if ($notnull_bool((member0 instanceof MethodMember) && $ne(member0.declaringType.get$library(), world.get$dom()))) {
var method = member0;
- method.genParameterValues();
+ if ($notnull_bool(method.needsArgumentConversion(args0))) {
+ return false;
+ }
for (var i = args0.get$length();
- i < method.parameters.length; i++) {
- if (method.parameters.$index(i).get$value().code != 'null') {
+ $notnull_bool(i < method.parameters.length); i++) {
+ if ($notnull_bool(method.parameters.$index(i).get$value().code != 'null')) {
return false;
}
}
@@ -17621,7 +17995,7 @@ VarMethodSet.prototype.invoke = function(context, node, target, args0) {
return VarMember.prototype.invoke.call(this, context, node, target, args0);
}
VarMethodSet.prototype._invokeMembers = function(context, node) {
- if (this._fallbackStubs != null) return;
+ if ($notnull_bool(this._fallbackStubs != null)) return;
this._fallbackStubs = [];
var $list = this.members;
for (var $i = 0;$i < $list.length; $i++) {
@@ -17630,8 +18004,8 @@ VarMethodSet.prototype._invokeMembers = function(context, node) {
var result = member.invoke$4(context, node, target, this.args);
var stub = new VarMethodStub(this.name, member, this.args, result);
var type = member.declaringType;
- if ($ne(type.get$library(), world.get$dom()) && !type.get$isObject()) {
- VarMethodSet._addVarStub(type, stub);
+ if ($notnull_bool($ne(type.get$library(), world.get$dom()) && !type.get$isObject())) {
+ VarMethodSet._addVarStub((type && type.is$lang_Type()), (stub && stub.is$VarMember()));
}
else {
this._fallbackStubs.add(stub);
@@ -17640,19 +18014,19 @@ VarMethodSet.prototype._invokeMembers = function(context, node) {
var target = new Value(world.objectType, 'this', false, true, false);
var result = target.invokeNoSuchMethod(context, this.get$baseName(), node, this.args);
var stub = new VarMethodStub(this.name, null, this.args, result);
- if (this._fallbackStubs.length == 0) {
- VarMethodSet._addVarStub(world.objectType, stub);
+ if ($notnull_bool(this._fallbackStubs.length == 0)) {
+ VarMethodSet._addVarStub(world.objectType, (stub && stub.is$VarMember()));
}
else {
this._fallbackStubs.add(stub);
}
}
VarMethodSet._addVarStub = function(type, stub) {
- if (type.varStubs == null) type.varStubs = $map([]);
+ if ($notnull_bool(type.varStubs == null)) type.varStubs = $map([]);
type.varStubs.$setindex(stub.name, stub);
}
VarMethodSet.prototype.generate = function(code) {
- if (this._fallbackStubs.length == 0) return;
+ if ($notnull_bool(this._fallbackStubs.length == 0)) return;
code.enterBlock(('\$varMethod("' + this.name + '", {'));
var $list = this._fallbackStubs;
for (var $i = 0;$i < $list.length; $i++) {
@@ -17663,15 +18037,19 @@ VarMethodSet.prototype.generate = function(code) {
}
code.exitBlock('});');
}
-VarMethodSet.prototype.invoke$4 = VarMethodSet.prototype.invoke;
+VarMethodSet.prototype.invoke$4 = function($0, $1, $2, $3) {
+ return this.invoke(($0 && $0.is$MethodGenerator()), ($1 && $1.is$lang_Node()), ($2 && $2.is$Value()), ($3 && $3.is$Arguments()));
+}
+;
// ********** Code for top level **************
function map(source, mapper) {
+ var $0;
var result = new ListFactory();
- if (!!(source && source.is$List)) {
+ if ($notnull_bool(!!(source && source.is$List))) {
var list = source;
result.length = list.length;
for (var i = 0;
- i < list.length; i++) {
+ $notnull_bool(i < list.length); i++) {
result.$setindex(i, mapper.call$1(list.$index(i)));
}
}
@@ -17686,15 +18064,16 @@ function map(source, mapper) {
function reduce(source, callback, initialValue) {
var i = source.iterator();
var current = initialValue;
- if (current == null && i.hasNext()) {
+ if ($notnull_bool(current == null && i.hasNext())) {
current = i.next();
}
- while (i.hasNext()) {
+ while ($notnull_bool(i.hasNext())) {
current = callback.call$2(current, i.next());
}
return current;
}
function orderValuesByKeys(map0) {
+ var $0;
var keys = map0.getKeys();
keys.sort((function (x, y) {
return x.compareTo(y);
@@ -17714,15 +18093,15 @@ function isRawMultilineString(text) {
return text.startsWith('@"""') || text.startsWith("@'''");
}
function parseStringLiteral(lit) {
- if (lit.startsWith('@')) {
- if (isRawMultilineString(lit)) {
+ if ($notnull_bool(lit.startsWith('@'))) {
+ if ($notnull_bool(isRawMultilineString(lit))) {
return stripLeadingNewline(lit.substring(4, lit.length - 3));
}
else {
return lit.substring(2, lit.length - 1);
}
}
- else if (isMultilineString(lit)) {
+ else if ($notnull_bool(isMultilineString(lit))) {
lit = lit.substring(3, lit.length - 3).replaceAll('\\\$', '\$');
return stripLeadingNewline(lit);
}
@@ -17731,11 +18110,11 @@ function parseStringLiteral(lit) {
}
}
function stripLeadingNewline(text) {
- if (text.startsWith('\n')) {
+ if ($notnull_bool(text.startsWith('\n'))) {
return text.substring(1);
}
- else if (text.startsWith('\r')) {
- if (text.startsWith('\r\n')) {
+ else if ($notnull_bool(text.startsWith('\r'))) {
+ if ($notnull_bool(text.startsWith('\r\n'))) {
return text.substring(2);
}
else {
@@ -17748,6 +18127,7 @@ function stripLeadingNewline(text) {
}
var world;
function initializeWorld(files) {
+ $assert(world == null, "world == null", "world.dart", 13, 10);
world = new World(files);
world.init();
}
@@ -17755,10 +18135,10 @@ function lang_compile(homedir, args, files) {
parseOptions(homedir, args, files);
initializeWorld(files);
var success = world.compile();
- if (options.outfile != null) {
- if (success) {
+ if ($notnull_bool(options.outfile != null)) {
+ if ($notnull_bool(success)) {
var code = world.getGeneratedCode();
- if (!options.outfile.endsWith('.js')) {
+ if ($notnull_bool(!options.outfile.endsWith('.js'))) {
code = '#!/usr/bin/env node\n' + code;
}
world.files.writeString(options.outfile, code);
@@ -17771,12 +18151,13 @@ function lang_compile(homedir, args, files) {
}
var options;
function parseOptions(homedir, args, files) {
+ $assert(options == null, "options == null", "frog_options.dart", 10, 10);
options = new FrogOptions(homedir, args, files);
}
function _getCallStubName(name, args) {
var nameBuilder = new StringBufferImpl(('' + name + '\$' + args.get$bareCount() + ''));
for (var i = args.get$bareCount();
- i < args.get$length(); i++) {
+ $notnull_bool(i < args.get$length()); i++) {
nameBuilder.add('\$').add(args.getName(i));
}
return nameBuilder.toString();
@@ -17784,13 +18165,14 @@ function _getCallStubName(name, args) {
// ********** Library frog **************
// ********** Code for top level **************
function main() {
- var homedir = get$path().dirname(get$fs().realpathSync(process.argv.$index(1)));
- if (lang_compile(homedir, process.argv, new NodeFileSystem())) {
+ var homedir = get$path().dirname(get$fs().realpathSync($assert_String(process.argv.$index(1))));
+ var argv = ListFactory.ListFactory$from$factory(process.argv);
+ if ($notnull_bool(lang_compile($assert_String(homedir), (argv && argv.is$List$String()), new NodeFileSystem()))) {
var code = world.getGeneratedCode();
- if (!options.compileOnly) {
- process.argv = [process.argv.$index(0), process.argv.$index(1)];
+ if ($notnull_bool(!options.compileOnly)) {
+ process.argv = [argv.$index(0), argv.$index(1)];
process.argv.addAll(options.childArgs);
- get$vm().runInNewContext(code, createSandbox());
+ get$vm().runInNewContext($assert_String(code), createSandbox());
}
}
else {
@@ -17824,7 +18206,7 @@ Function.prototype.call$2 = function($0, $1) {
return this.to$call$2()($0, $1);
};
function to$call$2(f) { return f && f.to$call$2(); }
-var const$1 = new StringWrapper('global scope')/*const SourceString('global scope')*/;
+var const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/;
var const$133 = new Keyword("break", false)/*const Keyword("break")*/;
var const$135 = new Keyword("case", false)/*const Keyword("case")*/;
var const$137 = new Keyword("catch", false)/*const Keyword("catch")*/;
@@ -17859,7 +18241,7 @@ var const$193 = new Keyword("extends", true)/*const Keyword("extends", true)*/;
var const$195 = new Keyword("factory", true)/*const Keyword("factory", true)*/;
var const$197 = new Keyword("get", true)/*const Keyword("get", true)*/;
var const$199 = new Keyword("implements", true)/*const Keyword("implements", true)*/;
-var const$2 = new StringWrapper('main')/*const SourceString('main')*/;
+var const$2 = new StringWrapper('global scope')/*const SourceString('global scope')*/;
var const$201 = new Keyword("import", true)/*const Keyword("import", true)*/;
var const$203 = new Keyword("interface", true)/*const Keyword("interface", true)*/;
var const$205 = new Keyword("library", true)/*const Keyword("library", true)*/;
@@ -17914,10 +18296,10 @@ var const$267 = new StringWrapper('\$div')/*const SourceString('\$div')*/;
var const$268 = new StringWrapper('\$mul')/*const SourceString('\$mul')*/;
var const$269 = new StringWrapper('\$sub')/*const SourceString('\$sub')*/;
var const$270 = new StringWrapper('\$tdiv')/*const SourceString('\$tdiv')*/;
-var const$392 = ImmutableList.ImmutableList$from$factory(['NullPointerException', 'ObjectNotClosureException', 'NoSuchMethodException', 'StackOverflowException'])/*const [
+var const$3 = new StringWrapper('main')/*const SourceString('main')*/;
+var const$393 = ImmutableList.ImmutableList$from$factory(['NullPointerException', 'ObjectNotClosureException', 'NoSuchMethodException', 'StackOverflowException'])/*const [
'NullPointerException', 'ObjectNotClosureException',
'NoSuchMethodException', 'StackOverflowException']*/;
-var const$4 = new NoMoreElementsException()/*const NoMoreElementsException()*/;
var const$5 = new EmptyQueueException()/*const EmptyQueueException()*/;
HTracer._singleton = null;
var const$222 = ImmutableList.ImmutableList$from$factory([const$133, const$135, const$137, const$139, const$141, const$143, const$145, const$147, const$149, const$151, const$153, const$155, const$157, const$159, const$161, const$163, const$165, const$167, const$169, const$171, const$173, const$175, const$177, const$179, const$181, const$183, const$185, const$187, const$189, const$191, const$193, const$195, const$197, const$199, const$201, const$203, const$205, const$207, const$209, const$211, const$213, const$215, const$217, const$219])/*const <Keyword> [

Powered by Google App Engine
This is Rietveld 408576698