| OLD | NEW |
| 1 #!/usr/bin/env node | 1 #!/usr/bin/env node |
| 2 // ********** Library dart:core ************** | 2 // ********** Library dart:core ************** |
| 3 // ********** Natives dart:core ************** | 3 // ********** Natives dart:core ************** |
| 4 function $throw(e) { | 4 function $throw(e) { |
| 5 // If e is not a value, we can use V8's captureStackTrace utility method. | 5 // If e is not a value, we can use V8's captureStackTrace utility method. |
| 6 // TODO(jmesserly): capture the stack trace on other JS engines. | 6 // TODO(jmesserly): capture the stack trace on other JS engines. |
| 7 if (e && (typeof e == 'object') && Error.captureStackTrace) { | 7 if (e && (typeof e == 'object') && Error.captureStackTrace) { |
| 8 // TODO(jmesserly): this will clobber the e.stack property | 8 // TODO(jmesserly): this will clobber the e.stack property |
| 9 Error.captureStackTrace(e, $throw); | 9 Error.captureStackTrace(e, $throw); |
| 10 } | 10 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 // ********** Code for Object ************** | 85 // ********** Code for Object ************** |
| 86 Object.defineProperty(Object.prototype, "get$dynamic", { value: function() { | 86 Object.defineProperty(Object.prototype, "get$dynamic", { value: function() { |
| 87 "use strict"; return this; | 87 "use strict"; return this; |
| 88 }, enumerable: false, writable: true, configurable: true }); | 88 }, enumerable: false, writable: true, configurable: true }); |
| 89 Object.defineProperty(Object.prototype, "noSuchMethod", { value: function(name,
args) { | 89 Object.defineProperty(Object.prototype, "noSuchMethod", { value: function(name,
args) { |
| 90 $throw(new NoSuchMethodException(this, name, args)); | 90 $throw(new NoSuchMethodException(this, name, args)); |
| 91 }, enumerable: false, writable: true, configurable: true }); | 91 }, enumerable: false, writable: true, configurable: true }); |
| 92 Object.defineProperty(Object.prototype, "_asNonSentinelEntry$0", { value: functi
on() { | 92 Object.defineProperty(Object.prototype, "_asNonSentinelEntry$0", { value: functi
on() { |
| 93 return this.noSuchMethod$2("_asNonSentinelEntry", []); | 93 return this.noSuchMethod("_asNonSentinelEntry", []); |
| 94 }, enumerable: false, writable: true, configurable: true }); | 94 }, enumerable: false, writable: true, configurable: true }); |
| 95 Object.defineProperty(Object.prototype, "_checkExtends$0", { value: function() { | 95 Object.defineProperty(Object.prototype, "_checkExtends$0", { value: function() { |
| 96 return this.noSuchMethod$2("_checkExtends", []); | 96 return this.noSuchMethod("_checkExtends", []); |
| 97 }, enumerable: false, writable: true, configurable: true }); | 97 }, enumerable: false, writable: true, configurable: true }); |
| 98 Object.defineProperty(Object.prototype, "_checkNonStatic$1", { value: function($
0) { | 98 Object.defineProperty(Object.prototype, "_checkNonStatic$1", { value: function($
0) { |
| 99 return this.noSuchMethod$2("_checkNonStatic", [$0]); | 99 return this.noSuchMethod("_checkNonStatic", [$0]); |
| 100 }, enumerable: false, writable: true, configurable: true }); | 100 }, enumerable: false, writable: true, configurable: true }); |
| 101 Object.defineProperty(Object.prototype, "_evalConstConstructor$2", { value: func
tion($0, $1) { | 101 Object.defineProperty(Object.prototype, "_evalConstConstructor$2", { value: func
tion($0, $1) { |
| 102 return this.noSuchMethod$2("_evalConstConstructor", [$0, $1]); | 102 return this.noSuchMethod("_evalConstConstructor", [$0, $1]); |
| 103 }, enumerable: false, writable: true, configurable: true }); | 103 }, enumerable: false, writable: true, configurable: true }); |
| 104 Object.defineProperty(Object.prototype, "_get$3", { value: function($0, $1, $2)
{ | 104 Object.defineProperty(Object.prototype, "_get$3", { value: function($0, $1, $2)
{ |
| 105 return this.noSuchMethod$2("_get", [$0, $1, $2]); | 105 return this.noSuchMethod("_get", [$0, $1, $2]); |
| 106 }, enumerable: false, writable: true, configurable: true }); | 106 }, enumerable: false, writable: true, configurable: true }); |
| 107 Object.defineProperty(Object.prototype, "_get$3$isDynamic", { value: function($0
, $1, $2, isDynamic) { | 107 Object.defineProperty(Object.prototype, "_get$3$isDynamic", { value: function($0
, $1, $2, isDynamic) { |
| 108 return this.noSuchMethod$2("_get", [$0, $1, $2, isDynamic]); | 108 return this.noSuchMethod("_get", [$0, $1, $2, isDynamic]); |
| 109 }, enumerable: false, writable: true, configurable: true }); | 109 }, enumerable: false, writable: true, configurable: true }); |
| 110 Object.defineProperty(Object.prototype, "_get$4", { value: function($0, $1, $2,
$3) { | 110 Object.defineProperty(Object.prototype, "_get$4", { value: function($0, $1, $2,
$3) { |
| 111 return this.noSuchMethod$2("_get", [$0, $1, $2, $3]); | 111 return this.noSuchMethod("_get", [$0, $1, $2, $3]); |
| 112 }, enumerable: false, writable: true, configurable: true }); | 112 }, enumerable: false, writable: true, configurable: true }); |
| 113 Object.defineProperty(Object.prototype, "_pushBlock$1", { value: function($0) { | 113 Object.defineProperty(Object.prototype, "_pushBlock$1", { value: function($0) { |
| 114 return this.noSuchMethod$2("_pushBlock", [$0]); | 114 return this.noSuchMethod("_pushBlock", [$0]); |
| 115 }, enumerable: false, writable: true, configurable: true }); |
| 116 Object.defineProperty(Object.prototype, "_set$4", { value: function($0, $1, $2,
$3) { |
| 117 return this.noSuchMethod("_set", [$0, $1, $2, $3]); |
| 115 }, enumerable: false, writable: true, configurable: true }); | 118 }, enumerable: false, writable: true, configurable: true }); |
| 116 Object.defineProperty(Object.prototype, "_set$4$isDynamic", { value: function($0
, $1, $2, $3, isDynamic) { | 119 Object.defineProperty(Object.prototype, "_set$4$isDynamic", { value: function($0
, $1, $2, $3, isDynamic) { |
| 117 return this.noSuchMethod$2("_set", [$0, $1, $2, $3, isDynamic]); | 120 return this.noSuchMethod("_set", [$0, $1, $2, $3, isDynamic]); |
| 118 }, enumerable: false, writable: true, configurable: true }); | 121 }, enumerable: false, writable: true, configurable: true }); |
| 119 Object.defineProperty(Object.prototype, "_set$5", { value: function($0, $1, $2,
$3, $4) { | 122 Object.defineProperty(Object.prototype, "_set$5", { value: function($0, $1, $2,
$3, $4) { |
| 120 return this.noSuchMethod$2("_set", [$0, $1, $2, $3, $4]); | 123 return this.noSuchMethod("_set", [$0, $1, $2, $3, $4]); |
| 121 }, enumerable: false, writable: true, configurable: true }); | 124 }, enumerable: false, writable: true, configurable: true }); |
| 122 Object.defineProperty(Object.prototype, "_setindex$2", { value: function($0, $1)
{ | 125 Object.defineProperty(Object.prototype, "_setindex$2", { value: function($0, $1)
{ |
| 123 return this.noSuchMethod$2("_setindex", [$0, $1]); | 126 return this.noSuchMethod("_setindex", [$0, $1]); |
| 124 }, enumerable: false, writable: true, configurable: true }); | 127 }, enumerable: false, writable: true, configurable: true }); |
| 125 Object.defineProperty(Object.prototype, "add$1", { value: function($0) { | 128 Object.defineProperty(Object.prototype, "add$1", { value: function($0) { |
| 126 return this.noSuchMethod$2("add", [$0]); | 129 return this.noSuchMethod("add", [$0]); |
| 127 }, enumerable: false, writable: true, configurable: true }); | 130 }, enumerable: false, writable: true, configurable: true }); |
| 128 Object.defineProperty(Object.prototype, "addAll$1", { value: function($0) { | 131 Object.defineProperty(Object.prototype, "addAll$1", { value: function($0) { |
| 129 return this.noSuchMethod$2("addAll", [$0]); | 132 return this.noSuchMethod("addAll", [$0]); |
| 130 }, enumerable: false, writable: true, configurable: true }); | 133 }, enumerable: false, writable: true, configurable: true }); |
| 131 Object.defineProperty(Object.prototype, "addDirectSubtype$1", { value: function(
$0) { | 134 Object.defineProperty(Object.prototype, "addDirectSubtype$1", { value: function(
$0) { |
| 132 return this.noSuchMethod$2("addDirectSubtype", [$0]); | 135 return this.noSuchMethod("addDirectSubtype", [$0]); |
| 133 }, enumerable: false, writable: true, configurable: true }); | 136 }, enumerable: false, writable: true, configurable: true }); |
| 134 Object.defineProperty(Object.prototype, "addLast$1", { value: function($0) { | 137 Object.defineProperty(Object.prototype, "addLast$1", { value: function($0) { |
| 135 return this.noSuchMethod$2("addLast", [$0]); | 138 return this.noSuchMethod("addLast", [$0]); |
| 136 }, enumerable: false, writable: true, configurable: true }); | 139 }, enumerable: false, writable: true, configurable: true }); |
| 137 Object.defineProperty(Object.prototype, "addMethod$2", { value: function($0, $1)
{ | 140 Object.defineProperty(Object.prototype, "addMethod$2", { value: function($0, $1)
{ |
| 138 return this.noSuchMethod$2("addMethod", [$0, $1]); | 141 return this.noSuchMethod("addMethod", [$0, $1]); |
| 139 }, enumerable: false, writable: true, configurable: true }); | 142 }, enumerable: false, writable: true, configurable: true }); |
| 140 Object.defineProperty(Object.prototype, "addSource$1", { value: function($0) { | 143 Object.defineProperty(Object.prototype, "addSource$1", { value: function($0) { |
| 141 return this.noSuchMethod$2("addSource", [$0]); | 144 return this.noSuchMethod("addSource", [$0]); |
| 142 }, enumerable: false, writable: true, configurable: true }); | 145 }, enumerable: false, writable: true, configurable: true }); |
| 143 Object.defineProperty(Object.prototype, "binop$4", { value: function($0, $1, $2,
$3) { | 146 Object.defineProperty(Object.prototype, "binop$4", { value: function($0, $1, $2,
$3) { |
| 144 return this.noSuchMethod$2("binop", [$0, $1, $2, $3]); | 147 return this.noSuchMethod("binop", [$0, $1, $2, $3]); |
| 145 }, enumerable: false, writable: true, configurable: true }); | 148 }, enumerable: false, writable: true, configurable: true }); |
| 146 Object.defineProperty(Object.prototype, "block$0", { value: function() { | 149 Object.defineProperty(Object.prototype, "block$0", { value: function() { |
| 147 return this.noSuchMethod$2("block", []); | 150 return this.noSuchMethod("block", []); |
| 148 }, enumerable: false, writable: true, configurable: true }); | 151 }, enumerable: false, writable: true, configurable: true }); |
| 149 Object.defineProperty(Object.prototype, "canInvoke$2", { value: function($0, $1)
{ | 152 Object.defineProperty(Object.prototype, "canInvoke$2", { value: function($0, $1)
{ |
| 150 return this.noSuchMethod$2("canInvoke", [$0, $1]); | 153 return this.noSuchMethod("canInvoke", [$0, $1]); |
| 151 }, enumerable: false, writable: true, configurable: true }); | 154 }, enumerable: false, writable: true, configurable: true }); |
| 152 Object.defineProperty(Object.prototype, "checkFirstClass$1", { value: function($
0) { | 155 Object.defineProperty(Object.prototype, "checkFirstClass$1", { value: function($
0) { |
| 153 return this.noSuchMethod$2("checkFirstClass", [$0]); | 156 return this.noSuchMethod("checkFirstClass", [$0]); |
| 154 }, enumerable: false, writable: true, configurable: true }); | 157 }, enumerable: false, writable: true, configurable: true }); |
| 155 Object.defineProperty(Object.prototype, "compareTo$1", { value: function($0) { | 158 Object.defineProperty(Object.prototype, "compareTo$1", { value: function($0) { |
| 156 return this.noSuchMethod$2("compareTo", [$0]); | 159 return this.noSuchMethod("compareTo", [$0]); |
| 157 }, enumerable: false, writable: true, configurable: true }); | 160 }, enumerable: false, writable: true, configurable: true }); |
| 158 Object.defineProperty(Object.prototype, "compilationUnit$0", { value: function()
{ | 161 Object.defineProperty(Object.prototype, "compilationUnit$0", { value: function()
{ |
| 159 return this.noSuchMethod$2("compilationUnit", []); | 162 return this.noSuchMethod("compilationUnit", []); |
| 160 }, enumerable: false, writable: true, configurable: true }); | 163 }, enumerable: false, writable: true, configurable: true }); |
| 161 Object.defineProperty(Object.prototype, "computeValue$0", { value: function() { | 164 Object.defineProperty(Object.prototype, "computeValue$0", { value: function() { |
| 162 return this.noSuchMethod$2("computeValue", []); | 165 return this.noSuchMethod("computeValue", []); |
| 163 }, enumerable: false, writable: true, configurable: true }); | 166 }, enumerable: false, writable: true, configurable: true }); |
| 164 Object.defineProperty(Object.prototype, "contains$1", { value: function($0) { | 167 Object.defineProperty(Object.prototype, "contains$1", { value: function($0) { |
| 165 return this.noSuchMethod$2("contains", [$0]); | 168 return this.noSuchMethod("contains", [$0]); |
| 166 }, enumerable: false, writable: true, configurable: true }); | 169 }, enumerable: false, writable: true, configurable: true }); |
| 167 Object.defineProperty(Object.prototype, "containsKey$1", { value: function($0) { | 170 Object.defineProperty(Object.prototype, "containsKey$1", { value: function($0) { |
| 168 return this.noSuchMethod$2("containsKey", [$0]); | 171 return this.noSuchMethod("containsKey", [$0]); |
| 169 }, enumerable: false, writable: true, configurable: true }); | 172 }, enumerable: false, writable: true, configurable: true }); |
| 170 Object.defineProperty(Object.prototype, "convertTo$2", { value: function($0, $1)
{ | 173 Object.defineProperty(Object.prototype, "convertTo$2", { value: function($0, $1)
{ |
| 171 return this.noSuchMethod$2("convertTo", [$0, $1]); | 174 return this.noSuchMethod("convertTo", [$0, $1]); |
| 172 }, enumerable: false, writable: true, configurable: true }); | 175 }, enumerable: false, writable: true, configurable: true }); |
| 173 Object.defineProperty(Object.prototype, "convertTo$3", { value: function($0, $1,
$2) { | 176 Object.defineProperty(Object.prototype, "convertTo$3", { value: function($0, $1,
$2) { |
| 174 return this.noSuchMethod$2("convertTo", [$0, $1, $2]); | 177 return this.noSuchMethod("convertTo", [$0, $1, $2]); |
| 175 }, enumerable: false, writable: true, configurable: true }); | 178 }, enumerable: false, writable: true, configurable: true }); |
| 176 Object.defineProperty(Object.prototype, "copyWithNewType$2", { value: function($
0, $1) { | 179 Object.defineProperty(Object.prototype, "copyWithNewType$2", { value: function($
0, $1) { |
| 177 return this.noSuchMethod$2("copyWithNewType", [$0, $1]); | 180 return this.noSuchMethod("copyWithNewType", [$0, $1]); |
| 178 }, enumerable: false, writable: true, configurable: true }); | 181 }, enumerable: false, writable: true, configurable: true }); |
| 179 Object.defineProperty(Object.prototype, "create$3$isFinal", { value: function($0
, $1, $2, isFinal) { | 182 Object.defineProperty(Object.prototype, "create$3$isFinal", { value: function($0
, $1, $2, isFinal) { |
| 180 return this.noSuchMethod$2("create", [$0, $1, $2, isFinal]); | 183 return this.noSuchMethod("create", [$0, $1, $2, isFinal]); |
| 181 }, enumerable: false, writable: true, configurable: true }); | 184 }, enumerable: false, writable: true, configurable: true }); |
| 182 Object.defineProperty(Object.prototype, "elapsedInMs$0", { value: function() { | 185 Object.defineProperty(Object.prototype, "elapsedInMs$0", { value: function() { |
| 183 return this.noSuchMethod$2("elapsedInMs", []); | 186 return this.noSuchMethod("elapsedInMs", []); |
| 184 }, enumerable: false, writable: true, configurable: true }); | 187 }, enumerable: false, writable: true, configurable: true }); |
| 185 Object.defineProperty(Object.prototype, "end$0", { value: function() { | 188 Object.defineProperty(Object.prototype, "end$0", { value: function() { |
| 186 return this.noSuchMethod$2("end", []); | 189 return this.noSuchMethod("end", []); |
| 187 }, enumerable: false, writable: true, configurable: true }); | 190 }, enumerable: false, writable: true, configurable: true }); |
| 188 Object.defineProperty(Object.prototype, "endsWith$1", { value: function($0) { | 191 Object.defineProperty(Object.prototype, "endsWith$1", { value: function($0) { |
| 189 return this.noSuchMethod$2("endsWith", [$0]); | 192 return this.noSuchMethod("endsWith", [$0]); |
| 190 }, enumerable: false, writable: true, configurable: true }); | 193 }, enumerable: false, writable: true, configurable: true }); |
| 191 Object.defineProperty(Object.prototype, "ensureSubtypeOf$3", { value: function($
0, $1, $2) { | 194 Object.defineProperty(Object.prototype, "ensureSubtypeOf$3", { value: function($
0, $1, $2) { |
| 192 return this.noSuchMethod$2("ensureSubtypeOf", [$0, $1, $2]); | 195 return this.noSuchMethod("ensureSubtypeOf", [$0, $1, $2]); |
| 193 }, enumerable: false, writable: true, configurable: true }); | 196 }, enumerable: false, writable: true, configurable: true }); |
| 194 Object.defineProperty(Object.prototype, "evalBody$2", { value: function($0, $1)
{ | 197 Object.defineProperty(Object.prototype, "evalBody$2", { value: function($0, $1)
{ |
| 195 return this.noSuchMethod$2("evalBody", [$0, $1]); | 198 return this.noSuchMethod("evalBody", [$0, $1]); |
| 199 }, enumerable: false, writable: true, configurable: true }); |
| 200 Object.defineProperty(Object.prototype, "every$1", { value: function($0) { |
| 201 return this.noSuchMethod("every", [$0]); |
| 196 }, enumerable: false, writable: true, configurable: true }); | 202 }, enumerable: false, writable: true, configurable: true }); |
| 197 Object.defineProperty(Object.prototype, "filter$1", { value: function($0) { | 203 Object.defineProperty(Object.prototype, "filter$1", { value: function($0) { |
| 198 return this.noSuchMethod$2("filter", [$0]); | 204 return this.noSuchMethod("filter", [$0]); |
| 199 }, enumerable: false, writable: true, configurable: true }); | 205 }, enumerable: false, writable: true, configurable: true }); |
| 200 Object.defineProperty(Object.prototype, "findTypeByName$1", { value: function($0
) { | 206 Object.defineProperty(Object.prototype, "findTypeByName$1", { value: function($0
) { |
| 201 return this.noSuchMethod$2("findTypeByName", [$0]); | 207 return this.noSuchMethod("findTypeByName", [$0]); |
| 202 }, enumerable: false, writable: true, configurable: true }); | 208 }, enumerable: false, writable: true, configurable: true }); |
| 203 Object.defineProperty(Object.prototype, "forEach$1", { value: function($0) { | 209 Object.defineProperty(Object.prototype, "forEach$1", { value: function($0) { |
| 204 return this.noSuchMethod$2("forEach", [$0]); | 210 return this.noSuchMethod("forEach", [$0]); |
| 205 }, enumerable: false, writable: true, configurable: true }); | 211 }, enumerable: false, writable: true, configurable: true }); |
| 206 Object.defineProperty(Object.prototype, "genValue$2", { value: function($0, $1)
{ | 212 Object.defineProperty(Object.prototype, "genValue$2", { value: function($0, $1)
{ |
| 207 return this.noSuchMethod$2("genValue", [$0, $1]); | 213 return this.noSuchMethod("genValue", [$0, $1]); |
| 208 }, enumerable: false, writable: true, configurable: true }); | 214 }, enumerable: false, writable: true, configurable: true }); |
| 209 Object.defineProperty(Object.prototype, "generate$1", { value: function($0) { | 215 Object.defineProperty(Object.prototype, "generate$1", { value: function($0) { |
| 210 return this.noSuchMethod$2("generate", [$0]); | 216 return this.noSuchMethod("generate", [$0]); |
| 211 }, enumerable: false, writable: true, configurable: true }); | 217 }, enumerable: false, writable: true, configurable: true }); |
| 212 Object.defineProperty(Object.prototype, "getColumn$2", { value: function($0, $1)
{ | 218 Object.defineProperty(Object.prototype, "getColumn$2", { value: function($0, $1)
{ |
| 213 return this.noSuchMethod$2("getColumn", [$0, $1]); | 219 return this.noSuchMethod("getColumn", [$0, $1]); |
| 214 }, enumerable: false, writable: true, configurable: true }); | 220 }, enumerable: false, writable: true, configurable: true }); |
| 215 Object.defineProperty(Object.prototype, "getConstructor$1", { value: function($0
) { | 221 Object.defineProperty(Object.prototype, "getConstructor$1", { value: function($0
) { |
| 216 return this.noSuchMethod$2("getConstructor", [$0]); | 222 return this.noSuchMethod("getConstructor", [$0]); |
| 217 }, enumerable: false, writable: true, configurable: true }); | 223 }, enumerable: false, writable: true, configurable: true }); |
| 218 Object.defineProperty(Object.prototype, "getFactory$2", { value: function($0, $1
) { | 224 Object.defineProperty(Object.prototype, "getFactory$2", { value: function($0, $1
) { |
| 219 return this.noSuchMethod$2("getFactory", [$0, $1]); | 225 return this.noSuchMethod("getFactory", [$0, $1]); |
| 220 }, enumerable: false, writable: true, configurable: true }); | 226 }, enumerable: false, writable: true, configurable: true }); |
| 221 Object.defineProperty(Object.prototype, "getGlobalValue$0", { value: function()
{ | 227 Object.defineProperty(Object.prototype, "getGlobalValue$0", { value: function()
{ |
| 222 return this.noSuchMethod$2("getGlobalValue", []); | 228 return this.noSuchMethod("getGlobalValue", []); |
| 223 }, enumerable: false, writable: true, configurable: true }); | 229 }, enumerable: false, writable: true, configurable: true }); |
| 224 Object.defineProperty(Object.prototype, "getKeys$0", { value: function() { | 230 Object.defineProperty(Object.prototype, "getKeys$0", { value: function() { |
| 225 return this.noSuchMethod$2("getKeys", []); | 231 return this.noSuchMethod("getKeys", []); |
| 226 }, enumerable: false, writable: true, configurable: true }); | 232 }, enumerable: false, writable: true, configurable: true }); |
| 227 Object.defineProperty(Object.prototype, "getLine$1", { value: function($0) { | 233 Object.defineProperty(Object.prototype, "getLine$1", { value: function($0) { |
| 228 return this.noSuchMethod$2("getLine", [$0]); | 234 return this.noSuchMethod("getLine", [$0]); |
| 229 }, enumerable: false, writable: true, configurable: true }); | 235 }, enumerable: false, writable: true, configurable: true }); |
| 230 Object.defineProperty(Object.prototype, "getMember$1", { value: function($0) { | 236 Object.defineProperty(Object.prototype, "getMember$1", { value: function($0) { |
| 231 return this.noSuchMethod$2("getMember", [$0]); | 237 return this.noSuchMethod("getMember", [$0]); |
| 232 }, enumerable: false, writable: true, configurable: true }); | 238 }, enumerable: false, writable: true, configurable: true }); |
| 233 Object.defineProperty(Object.prototype, "getOrMakeConcreteType$1", { value: func
tion($0) { | 239 Object.defineProperty(Object.prototype, "getOrMakeConcreteType$1", { value: func
tion($0) { |
| 234 return this.noSuchMethod$2("getOrMakeConcreteType", [$0]); | 240 return this.noSuchMethod("getOrMakeConcreteType", [$0]); |
| 241 }, enumerable: false, writable: true, configurable: true }); |
| 242 Object.defineProperty(Object.prototype, "getRange$2", { value: function($0, $1)
{ |
| 243 return this.noSuchMethod("getRange", [$0, $1]); |
| 235 }, enumerable: false, writable: true, configurable: true }); | 244 }, enumerable: false, writable: true, configurable: true }); |
| 236 Object.defineProperty(Object.prototype, "getValues$0", { value: function() { | 245 Object.defineProperty(Object.prototype, "getValues$0", { value: function() { |
| 237 return this.noSuchMethod$2("getValues", []); | 246 return this.noSuchMethod("getValues", []); |
| 238 }, enumerable: false, writable: true, configurable: true }); | 247 }, enumerable: false, writable: true, configurable: true }); |
| 239 Object.defineProperty(Object.prototype, "get_$3", { value: function($0, $1, $2)
{ | 248 Object.defineProperty(Object.prototype, "get_$3", { value: function($0, $1, $2)
{ |
| 240 return this.noSuchMethod$2("get_", [$0, $1, $2]); | 249 return this.noSuchMethod("get_", [$0, $1, $2]); |
| 241 }, enumerable: false, writable: true, configurable: true }); | 250 }, enumerable: false, writable: true, configurable: true }); |
| 242 Object.defineProperty(Object.prototype, "hasNext$0", { value: function() { | 251 Object.defineProperty(Object.prototype, "hasNext$0", { value: function() { |
| 243 return this.noSuchMethod$2("hasNext", []); | 252 return this.noSuchMethod("hasNext", []); |
| 244 }, enumerable: false, writable: true, configurable: true }); | 253 }, enumerable: false, writable: true, configurable: true }); |
| 245 Object.defineProperty(Object.prototype, "hashCode$0", { value: function() { | 254 Object.defineProperty(Object.prototype, "hashCode$0", { value: function() { |
| 246 return this.noSuchMethod$2("hashCode", []); | 255 return this.noSuchMethod("hashCode", []); |
| 247 }, enumerable: false, writable: true, configurable: true }); | 256 }, enumerable: false, writable: true, configurable: true }); |
| 248 Object.defineProperty(Object.prototype, "indexOf$1", { value: function($0) { | 257 Object.defineProperty(Object.prototype, "indexOf$1", { value: function($0) { |
| 249 return this.noSuchMethod$2("indexOf", [$0]); | 258 return this.noSuchMethod("indexOf", [$0]); |
| 250 }, enumerable: false, writable: true, configurable: true }); | 259 }, enumerable: false, writable: true, configurable: true }); |
| 251 Object.defineProperty(Object.prototype, "initFields$0", { value: function() { | 260 Object.defineProperty(Object.prototype, "initFields$0", { value: function() { |
| 252 return this.noSuchMethod$2("initFields", []); | 261 return this.noSuchMethod("initFields", []); |
| 253 }, enumerable: false, writable: true, configurable: true }); | 262 }, enumerable: false, writable: true, configurable: true }); |
| 254 Object.defineProperty(Object.prototype, "instanceOf$3$isTrue$forceCheck", { valu
e: function($0, $1, $2, isTrue, forceCheck) { | 263 Object.defineProperty(Object.prototype, "instanceOf$3$isTrue$forceCheck", { valu
e: function($0, $1, $2, isTrue, forceCheck) { |
| 255 return this.noSuchMethod$2("instanceOf", [$0, $1, $2, isTrue, forceCheck]); | 264 return this.noSuchMethod("instanceOf", [$0, $1, $2, isTrue, forceCheck]); |
| 256 }, enumerable: false, writable: true, configurable: true }); | 265 }, enumerable: false, writable: true, configurable: true }); |
| 257 Object.defineProperty(Object.prototype, "instanceOf$4", { value: function($0, $1
, $2, $3) { | 266 Object.defineProperty(Object.prototype, "instanceOf$4", { value: function($0, $1
, $2, $3) { |
| 258 return this.noSuchMethod$2("instanceOf", [$0, $1, $2, $3]); | 267 return this.noSuchMethod("instanceOf", [$0, $1, $2, $3]); |
| 259 }, enumerable: false, writable: true, configurable: true }); | 268 }, enumerable: false, writable: true, configurable: true }); |
| 260 Object.defineProperty(Object.prototype, "invoke$4", { value: function($0, $1, $2
, $3) { | 269 Object.defineProperty(Object.prototype, "invoke$4", { value: function($0, $1, $2
, $3) { |
| 261 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3]); | 270 return this.noSuchMethod("invoke", [$0, $1, $2, $3]); |
| 262 }, enumerable: false, writable: true, configurable: true }); | 271 }, enumerable: false, writable: true, configurable: true }); |
| 263 Object.defineProperty(Object.prototype, "invoke$4$isDynamic", { value: function(
$0, $1, $2, $3, isDynamic) { | 272 Object.defineProperty(Object.prototype, "invoke$4$isDynamic", { value: function(
$0, $1, $2, $3, isDynamic) { |
| 264 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3, isDynamic]); | 273 return this.noSuchMethod("invoke", [$0, $1, $2, $3, isDynamic]); |
| 265 }, enumerable: false, writable: true, configurable: true }); | 274 }, enumerable: false, writable: true, configurable: true }); |
| 266 Object.defineProperty(Object.prototype, "invoke$5", { value: function($0, $1, $2
, $3, $4) { | 275 Object.defineProperty(Object.prototype, "invoke$5", { value: function($0, $1, $2
, $3, $4) { |
| 267 return this.noSuchMethod$2("invoke", [$0, $1, $2, $3, $4]); | 276 return this.noSuchMethod("invoke", [$0, $1, $2, $3, $4]); |
| 268 }, enumerable: false, writable: true, configurable: true }); | 277 }, enumerable: false, writable: true, configurable: true }); |
| 269 Object.defineProperty(Object.prototype, "invokeNoSuchMethod$4", { value: functio
n($0, $1, $2, $3) { | 278 Object.defineProperty(Object.prototype, "invokeNoSuchMethod$4", { value: functio
n($0, $1, $2, $3) { |
| 270 return this.noSuchMethod$2("invokeNoSuchMethod", [$0, $1, $2, $3]); | 279 return this.noSuchMethod("invokeNoSuchMethod", [$0, $1, $2, $3]); |
| 271 }, enumerable: false, writable: true, configurable: true }); | 280 }, enumerable: false, writable: true, configurable: true }); |
| 272 Object.defineProperty(Object.prototype, "is$List", { value: function() { | 281 Object.defineProperty(Object.prototype, "is$List", { value: function() { |
| 273 return false; | 282 return false; |
| 274 }, enumerable: false, writable: true, configurable: true }); | 283 }, enumerable: false, writable: true, configurable: true }); |
| 275 Object.defineProperty(Object.prototype, "is$RegExp", { value: function() { | 284 Object.defineProperty(Object.prototype, "is$RegExp", { value: function() { |
| 276 return false; | 285 return false; |
| 277 }, enumerable: false, writable: true, configurable: true }); | 286 }, enumerable: false, writable: true, configurable: true }); |
| 278 Object.defineProperty(Object.prototype, "isAssignable$1", { value: function($0)
{ | 287 Object.defineProperty(Object.prototype, "isAssignable$1", { value: function($0)
{ |
| 279 return this.noSuchMethod$2("isAssignable", [$0]); | 288 return this.noSuchMethod("isAssignable", [$0]); |
| 280 }, enumerable: false, writable: true, configurable: true }); | 289 }, enumerable: false, writable: true, configurable: true }); |
| 281 Object.defineProperty(Object.prototype, "isEmpty$0", { value: function() { | 290 Object.defineProperty(Object.prototype, "isEmpty$0", { value: function() { |
| 282 return this.noSuchMethod$2("isEmpty", []); | 291 return this.noSuchMethod("isEmpty", []); |
| 283 }, enumerable: false, writable: true, configurable: true }); | 292 }, enumerable: false, writable: true, configurable: true }); |
| 284 Object.defineProperty(Object.prototype, "isSubtypeOf$1", { value: function($0) { | 293 Object.defineProperty(Object.prototype, "isSubtypeOf$1", { value: function($0) { |
| 285 return this.noSuchMethod$2("isSubtypeOf", [$0]); | 294 return this.noSuchMethod("isSubtypeOf", [$0]); |
| 286 }, enumerable: false, writable: true, configurable: true }); | 295 }, enumerable: false, writable: true, configurable: true }); |
| 287 Object.defineProperty(Object.prototype, "iterator$0", { value: function() { | 296 Object.defineProperty(Object.prototype, "iterator$0", { value: function() { |
| 288 return this.noSuchMethod$2("iterator", []); | 297 return this.noSuchMethod("iterator", []); |
| 289 }, enumerable: false, writable: true, configurable: true }); | 298 }, enumerable: false, writable: true, configurable: true }); |
| 290 Object.defineProperty(Object.prototype, "last$0", { value: function() { | 299 Object.defineProperty(Object.prototype, "last$0", { value: function() { |
| 291 return this.noSuchMethod$2("last", []); | 300 return this.noSuchMethod("last", []); |
| 292 }, enumerable: false, writable: true, configurable: true }); | 301 }, enumerable: false, writable: true, configurable: true }); |
| 293 Object.defineProperty(Object.prototype, "lookup$2", { value: function($0, $1) { | 302 Object.defineProperty(Object.prototype, "lookup$2", { value: function($0, $1) { |
| 294 return this.noSuchMethod$2("lookup", [$0, $1]); | 303 return this.noSuchMethod("lookup", [$0, $1]); |
| 295 }, enumerable: false, writable: true, configurable: true }); | 304 }, enumerable: false, writable: true, configurable: true }); |
| 296 Object.defineProperty(Object.prototype, "markUsed$0", { value: function() { | 305 Object.defineProperty(Object.prototype, "markUsed$0", { value: function() { |
| 297 return this.noSuchMethod$2("markUsed", []); | 306 return this.noSuchMethod("markUsed", []); |
| 298 }, enumerable: false, writable: true, configurable: true }); | 307 }, enumerable: false, writable: true, configurable: true }); |
| 299 Object.defineProperty(Object.prototype, "namesInOrder$1", { value: function($0)
{ | 308 Object.defineProperty(Object.prototype, "namesInOrder$1", { value: function($0)
{ |
| 300 return this.noSuchMethod$2("namesInOrder", [$0]); | 309 return this.noSuchMethod("namesInOrder", [$0]); |
| 301 }, enumerable: false, writable: true, configurable: true }); | 310 }, enumerable: false, writable: true, configurable: true }); |
| 302 Object.defineProperty(Object.prototype, "needsConversion$1", { value: function($
0) { | 311 Object.defineProperty(Object.prototype, "needsConversion$1", { value: function($
0) { |
| 303 return this.noSuchMethod$2("needsConversion", [$0]); | 312 return this.noSuchMethod("needsConversion", [$0]); |
| 304 }, enumerable: false, writable: true, configurable: true }); | 313 }, enumerable: false, writable: true, configurable: true }); |
| 305 Object.defineProperty(Object.prototype, "next$0", { value: function() { | 314 Object.defineProperty(Object.prototype, "next$0", { value: function() { |
| 306 return this.noSuchMethod$2("next", []); | 315 return this.noSuchMethod("next", []); |
| 307 }, enumerable: false, writable: true, configurable: true }); | |
| 308 Object.defineProperty(Object.prototype, "noSuchMethod$2", { value: function($0,
$1) { | |
| 309 return this.noSuchMethod($0, $1); | |
| 310 }, enumerable: false, writable: true, configurable: true }); | 316 }, enumerable: false, writable: true, configurable: true }); |
| 311 Object.defineProperty(Object.prototype, "postResolveChecks$0", { value: function
() { | 317 Object.defineProperty(Object.prototype, "postResolveChecks$0", { value: function
() { |
| 312 return this.noSuchMethod$2("postResolveChecks", []); | 318 return this.noSuchMethod("postResolveChecks", []); |
| 313 }, enumerable: false, writable: true, configurable: true }); | 319 }, enumerable: false, writable: true, configurable: true }); |
| 314 Object.defineProperty(Object.prototype, "provideFieldSyntax$0", { value: functio
n() { | 320 Object.defineProperty(Object.prototype, "provideFieldSyntax$0", { value: functio
n() { |
| 315 return this.noSuchMethod$2("provideFieldSyntax", []); | 321 return this.noSuchMethod("provideFieldSyntax", []); |
| 316 }, enumerable: false, writable: true, configurable: true }); | 322 }, enumerable: false, writable: true, configurable: true }); |
| 317 Object.defineProperty(Object.prototype, "providePropertySyntax$0", { value: func
tion() { | 323 Object.defineProperty(Object.prototype, "providePropertySyntax$0", { value: func
tion() { |
| 318 return this.noSuchMethod$2("providePropertySyntax", []); | 324 return this.noSuchMethod("providePropertySyntax", []); |
| 325 }, enumerable: false, writable: true, configurable: true }); |
| 326 Object.defineProperty(Object.prototype, "putIfAbsent$2", { value: function($0, $
1) { |
| 327 return this.noSuchMethod("putIfAbsent", [$0, $1]); |
| 328 }, enumerable: false, writable: true, configurable: true }); |
| 329 Object.defineProperty(Object.prototype, "removeFirst$0", { value: function() { |
| 330 return this.noSuchMethod("removeFirst", []); |
| 319 }, enumerable: false, writable: true, configurable: true }); | 331 }, enumerable: false, writable: true, configurable: true }); |
| 320 Object.defineProperty(Object.prototype, "removeLast$0", { value: function() { | 332 Object.defineProperty(Object.prototype, "removeLast$0", { value: function() { |
| 321 return this.noSuchMethod$2("removeLast", []); | 333 return this.noSuchMethod("removeLast", []); |
| 322 }, enumerable: false, writable: true, configurable: true }); | 334 }, enumerable: false, writable: true, configurable: true }); |
| 323 Object.defineProperty(Object.prototype, "replaceFirst$2", { value: function($0,
$1) { | 335 Object.defineProperty(Object.prototype, "replaceFirst$2", { value: function($0,
$1) { |
| 324 return this.noSuchMethod$2("replaceFirst", [$0, $1]); | 336 return this.noSuchMethod("replaceFirst", [$0, $1]); |
| 325 }, enumerable: false, writable: true, configurable: true }); | 337 }, enumerable: false, writable: true, configurable: true }); |
| 326 Object.defineProperty(Object.prototype, "replaceValue$1", { value: function($0)
{ | 338 Object.defineProperty(Object.prototype, "replaceValue$1", { value: function($0)
{ |
| 327 return this.noSuchMethod$2("replaceValue", [$0]); | 339 return this.noSuchMethod("replaceValue", [$0]); |
| 328 }, enumerable: false, writable: true, configurable: true }); | 340 }, enumerable: false, writable: true, configurable: true }); |
| 329 Object.defineProperty(Object.prototype, "resolve$0", { value: function() { | 341 Object.defineProperty(Object.prototype, "resolve$0", { value: function() { |
| 330 return this.noSuchMethod$2("resolve", []); | 342 return this.noSuchMethod("resolve", []); |
| 331 }, enumerable: false, writable: true, configurable: true }); | 343 }, enumerable: false, writable: true, configurable: true }); |
| 332 Object.defineProperty(Object.prototype, "resolveType$2", { value: function($0, $
1) { | 344 Object.defineProperty(Object.prototype, "resolveType$2", { value: function($0, $
1) { |
| 333 return this.noSuchMethod$2("resolveType", [$0, $1]); | 345 return this.noSuchMethod("resolveType", [$0, $1]); |
| 334 }, enumerable: false, writable: true, configurable: true }); | 346 }, enumerable: false, writable: true, configurable: true }); |
| 335 Object.defineProperty(Object.prototype, "resolveTypeParams$1", { value: function
($0) { | 347 Object.defineProperty(Object.prototype, "resolveTypeParams$1", { value: function
($0) { |
| 336 return this.noSuchMethod$2("resolveTypeParams", [$0]); | 348 return this.noSuchMethod("resolveTypeParams", [$0]); |
| 337 }, enumerable: false, writable: true, configurable: true }); | 349 }, enumerable: false, writable: true, configurable: true }); |
| 338 Object.defineProperty(Object.prototype, "run$0", { value: function() { | 350 Object.defineProperty(Object.prototype, "run$0", { value: function() { |
| 339 return this.noSuchMethod$2("run", []); | 351 return this.noSuchMethod("run", []); |
| 340 }, enumerable: false, writable: true, configurable: true }); | 352 }, enumerable: false, writable: true, configurable: true }); |
| 341 Object.defineProperty(Object.prototype, "setDefinition$1", { value: function($0)
{ | 353 Object.defineProperty(Object.prototype, "setDefinition$1", { value: function($0)
{ |
| 342 return this.noSuchMethod$2("setDefinition", [$0]); | 354 return this.noSuchMethod("setDefinition", [$0]); |
| 343 }, enumerable: false, writable: true, configurable: true }); | 355 }, enumerable: false, writable: true, configurable: true }); |
| 344 Object.defineProperty(Object.prototype, "setIndex$4$kind$returnKind", { value: f
unction($0, $1, $2, $3, kind, returnKind) { | 356 Object.defineProperty(Object.prototype, "set_$4", { value: function($0, $1, $2,
$3) { |
| 345 return this.noSuchMethod$2("setIndex", [$0, $1, $2, $3, kind, returnKind]); | 357 return this.noSuchMethod("set_", [$0, $1, $2, $3]); |
| 346 }, enumerable: false, writable: true, configurable: true }); | 358 }, enumerable: false, writable: true, configurable: true }); |
| 347 Object.defineProperty(Object.prototype, "set_$4$kind$returnKind", { value: funct
ion($0, $1, $2, $3, kind, returnKind) { | 359 Object.defineProperty(Object.prototype, "some$1", { value: function($0) { |
| 348 return this.noSuchMethod$2("set_", [$0, $1, $2, $3, kind, returnKind]); | 360 return this.noSuchMethod("some", [$0]); |
| 349 }, enumerable: false, writable: true, configurable: true }); | 361 }, enumerable: false, writable: true, configurable: true }); |
| 350 Object.defineProperty(Object.prototype, "sort$1", { value: function($0) { | 362 Object.defineProperty(Object.prototype, "sort$1", { value: function($0) { |
| 351 return this.noSuchMethod$2("sort", [$0]); | 363 return this.noSuchMethod("sort", [$0]); |
| 352 }, enumerable: false, writable: true, configurable: true }); | 364 }, enumerable: false, writable: true, configurable: true }); |
| 353 Object.defineProperty(Object.prototype, "start$0", { value: function() { | 365 Object.defineProperty(Object.prototype, "start$0", { value: function() { |
| 354 return this.noSuchMethod$2("start", []); | 366 return this.noSuchMethod("start", []); |
| 355 }, enumerable: false, writable: true, configurable: true }); | 367 }, enumerable: false, writable: true, configurable: true }); |
| 356 Object.defineProperty(Object.prototype, "startsWith$1", { value: function($0) { | 368 Object.defineProperty(Object.prototype, "startsWith$1", { value: function($0) { |
| 357 return this.noSuchMethod$2("startsWith", [$0]); | 369 return this.noSuchMethod("startsWith", [$0]); |
| 358 }, enumerable: false, writable: true, configurable: true }); | 370 }, enumerable: false, writable: true, configurable: true }); |
| 359 Object.defineProperty(Object.prototype, "stop$0", { value: function() { | 371 Object.defineProperty(Object.prototype, "stop$0", { value: function() { |
| 360 return this.noSuchMethod$2("stop", []); | 372 return this.noSuchMethod("stop", []); |
| 361 }, enumerable: false, writable: true, configurable: true }); | 373 }, enumerable: false, writable: true, configurable: true }); |
| 362 Object.defineProperty(Object.prototype, "substring$1", { value: function($0) { | 374 Object.defineProperty(Object.prototype, "substring$1", { value: function($0) { |
| 363 return this.noSuchMethod$2("substring", [$0]); | 375 return this.noSuchMethod("substring", [$0]); |
| 364 }, enumerable: false, writable: true, configurable: true }); | 376 }, enumerable: false, writable: true, configurable: true }); |
| 365 Object.defineProperty(Object.prototype, "substring$2", { value: function($0, $1)
{ | 377 Object.defineProperty(Object.prototype, "substring$2", { value: function($0, $1)
{ |
| 366 return this.noSuchMethod$2("substring", [$0, $1]); | 378 return this.noSuchMethod("substring", [$0, $1]); |
| 367 }, enumerable: false, writable: true, configurable: true }); | 379 }, enumerable: false, writable: true, configurable: true }); |
| 368 Object.defineProperty(Object.prototype, "toRadixString$1", { value: function($0)
{ | 380 Object.defineProperty(Object.prototype, "toRadixString$1", { value: function($0)
{ |
| 369 return this.noSuchMethod$2("toRadixString", [$0]); | 381 return this.noSuchMethod("toRadixString", [$0]); |
| 370 }, enumerable: false, writable: true, configurable: true }); | 382 }, enumerable: false, writable: true, configurable: true }); |
| 371 Object.defineProperty(Object.prototype, "toString$0", { value: function() { | 383 Object.defineProperty(Object.prototype, "toString$0", { value: function() { |
| 372 return this.toString(); | 384 return this.toString(); |
| 373 }, enumerable: false, writable: true, configurable: true }); | 385 }, enumerable: false, writable: true, configurable: true }); |
| 374 Object.defineProperty(Object.prototype, "unop$3", { value: function($0, $1, $2)
{ | 386 Object.defineProperty(Object.prototype, "unop$3", { value: function($0, $1, $2)
{ |
| 375 return this.noSuchMethod$2("unop", [$0, $1, $2]); | 387 return this.noSuchMethod("unop", [$0, $1, $2]); |
| 376 }, enumerable: false, writable: true, configurable: true }); | 388 }, enumerable: false, writable: true, configurable: true }); |
| 377 Object.defineProperty(Object.prototype, "visit$1", { value: function($0) { | 389 Object.defineProperty(Object.prototype, "visit$1", { value: function($0) { |
| 378 return this.noSuchMethod$2("visit", [$0]); | 390 return this.noSuchMethod("visit", [$0]); |
| 379 }, enumerable: false, writable: true, configurable: true }); | |
| 380 Object.defineProperty(Object.prototype, "visitAssertStatement$1", { value: funct
ion($0) { | |
| 381 return this.noSuchMethod$2("visitAssertStatement", [$0]); | |
| 382 }, enumerable: false, writable: true, configurable: true }); | 391 }, enumerable: false, writable: true, configurable: true }); |
| 383 Object.defineProperty(Object.prototype, "visitBinaryExpression$1", { value: func
tion($0) { | 392 Object.defineProperty(Object.prototype, "visitBinaryExpression$1", { value: func
tion($0) { |
| 384 return this.noSuchMethod$2("visitBinaryExpression", [$0]); | 393 return this.noSuchMethod("visitBinaryExpression", [$0]); |
| 385 }, enumerable: false, writable: true, configurable: true }); | |
| 386 Object.defineProperty(Object.prototype, "visitBlockStatement$1", { value: functi
on($0) { | |
| 387 return this.noSuchMethod$2("visitBlockStatement", [$0]); | |
| 388 }, enumerable: false, writable: true, configurable: true }); | |
| 389 Object.defineProperty(Object.prototype, "visitBreakStatement$1", { value: functi
on($0) { | |
| 390 return this.noSuchMethod$2("visitBreakStatement", [$0]); | |
| 391 }, enumerable: false, writable: true, configurable: true }); | |
| 392 Object.defineProperty(Object.prototype, "visitContinueStatement$1", { value: fun
ction($0) { | |
| 393 return this.noSuchMethod$2("visitContinueStatement", [$0]); | |
| 394 }, enumerable: false, writable: true, configurable: true }); | |
| 395 Object.defineProperty(Object.prototype, "visitDeclaredIdentifier$1", { value: fu
nction($0) { | |
| 396 return this.noSuchMethod$2("visitDeclaredIdentifier", [$0]); | |
| 397 }, enumerable: false, writable: true, configurable: true }); | |
| 398 Object.defineProperty(Object.prototype, "visitDietStatement$1", { value: functio
n($0) { | |
| 399 return this.noSuchMethod$2("visitDietStatement", [$0]); | |
| 400 }, enumerable: false, writable: true, configurable: true }); | |
| 401 Object.defineProperty(Object.prototype, "visitDoStatement$1", { value: function(
$0) { | |
| 402 return this.noSuchMethod$2("visitDoStatement", [$0]); | |
| 403 }, enumerable: false, writable: true, configurable: true }); | |
| 404 Object.defineProperty(Object.prototype, "visitEmptyStatement$1", { value: functi
on($0) { | |
| 405 return this.noSuchMethod$2("visitEmptyStatement", [$0]); | |
| 406 }, enumerable: false, writable: true, configurable: true }); | |
| 407 Object.defineProperty(Object.prototype, "visitExpressionStatement$1", { value: f
unction($0) { | |
| 408 return this.noSuchMethod$2("visitExpressionStatement", [$0]); | |
| 409 }, enumerable: false, writable: true, configurable: true }); | |
| 410 Object.defineProperty(Object.prototype, "visitForInStatement$1", { value: functi
on($0) { | |
| 411 return this.noSuchMethod$2("visitForInStatement", [$0]); | |
| 412 }, enumerable: false, writable: true, configurable: true }); | |
| 413 Object.defineProperty(Object.prototype, "visitForStatement$1", { value: function
($0) { | |
| 414 return this.noSuchMethod$2("visitForStatement", [$0]); | |
| 415 }, enumerable: false, writable: true, configurable: true }); | |
| 416 Object.defineProperty(Object.prototype, "visitFunctionDefinition$1", { value: fu
nction($0) { | |
| 417 return this.noSuchMethod$2("visitFunctionDefinition", [$0]); | |
| 418 }, enumerable: false, writable: true, configurable: true }); | |
| 419 Object.defineProperty(Object.prototype, "visitIfStatement$1", { value: function(
$0) { | |
| 420 return this.noSuchMethod$2("visitIfStatement", [$0]); | |
| 421 }, enumerable: false, writable: true, configurable: true }); | |
| 422 Object.defineProperty(Object.prototype, "visitIndexExpression$1", { value: funct
ion($0) { | |
| 423 return this.noSuchMethod$2("visitIndexExpression", [$0]); | |
| 424 }, enumerable: false, writable: true, configurable: true }); | |
| 425 Object.defineProperty(Object.prototype, "visitLabeledStatement$1", { value: func
tion($0) { | |
| 426 return this.noSuchMethod$2("visitLabeledStatement", [$0]); | |
| 427 }, enumerable: false, writable: true, configurable: true }); | |
| 428 Object.defineProperty(Object.prototype, "visitLambdaExpression$1", { value: func
tion($0) { | |
| 429 return this.noSuchMethod$2("visitLambdaExpression", [$0]); | |
| 430 }, enumerable: false, writable: true, configurable: true }); | |
| 431 Object.defineProperty(Object.prototype, "visitLiteralExpression$1", { value: fun
ction($0) { | |
| 432 return this.noSuchMethod$2("visitLiteralExpression", [$0]); | |
| 433 }, enumerable: false, writable: true, configurable: true }); | |
| 434 Object.defineProperty(Object.prototype, "visitMapExpression$1", { value: functio
n($0) { | |
| 435 return this.noSuchMethod$2("visitMapExpression", [$0]); | |
| 436 }, enumerable: false, writable: true, configurable: true }); | |
| 437 Object.defineProperty(Object.prototype, "visitNewExpression$1", { value: functio
n($0) { | |
| 438 return this.noSuchMethod$2("visitNewExpression", [$0]); | |
| 439 }, enumerable: false, writable: true, configurable: true }); | 394 }, enumerable: false, writable: true, configurable: true }); |
| 440 Object.defineProperty(Object.prototype, "visitPostfixExpression$1", { value: fun
ction($0) { | 395 Object.defineProperty(Object.prototype, "visitPostfixExpression$1", { value: fun
ction($0) { |
| 441 return this.noSuchMethod$2("visitPostfixExpression", [$0]); | 396 return this.noSuchMethod("visitPostfixExpression", [$0]); |
| 442 }, enumerable: false, writable: true, configurable: true }); | |
| 443 Object.defineProperty(Object.prototype, "visitReturnStatement$1", { value: funct
ion($0) { | |
| 444 return this.noSuchMethod$2("visitReturnStatement", [$0]); | |
| 445 }, enumerable: false, writable: true, configurable: true }); | 397 }, enumerable: false, writable: true, configurable: true }); |
| 446 Object.defineProperty(Object.prototype, "visitSources$0", { value: function() { | 398 Object.defineProperty(Object.prototype, "visitSources$0", { value: function() { |
| 447 return this.noSuchMethod$2("visitSources", []); | 399 return this.noSuchMethod("visitSources", []); |
| 448 }, enumerable: false, writable: true, configurable: true }); | |
| 449 Object.defineProperty(Object.prototype, "visitSwitchStatement$1", { value: funct
ion($0) { | |
| 450 return this.noSuchMethod$2("visitSwitchStatement", [$0]); | |
| 451 }, enumerable: false, writable: true, configurable: true }); | |
| 452 Object.defineProperty(Object.prototype, "visitThrowStatement$1", { value: functi
on($0) { | |
| 453 return this.noSuchMethod$2("visitThrowStatement", [$0]); | |
| 454 }, enumerable: false, writable: true, configurable: true }); | |
| 455 Object.defineProperty(Object.prototype, "visitTryStatement$1", { value: function
($0) { | |
| 456 return this.noSuchMethod$2("visitTryStatement", [$0]); | |
| 457 }, enumerable: false, writable: true, configurable: true }); | |
| 458 Object.defineProperty(Object.prototype, "visitVariableDefinition$1", { value: fu
nction($0) { | |
| 459 return this.noSuchMethod$2("visitVariableDefinition", [$0]); | |
| 460 }, enumerable: false, writable: true, configurable: true }); | |
| 461 Object.defineProperty(Object.prototype, "visitWhileStatement$1", { value: functi
on($0) { | |
| 462 return this.noSuchMethod$2("visitWhileStatement", [$0]); | |
| 463 }, enumerable: false, writable: true, configurable: true }); | 400 }, enumerable: false, writable: true, configurable: true }); |
| 464 Object.defineProperty(Object.prototype, "write$1", { value: function($0) { | 401 Object.defineProperty(Object.prototype, "write$1", { value: function($0) { |
| 465 return this.noSuchMethod$2("write", [$0]); | 402 return this.noSuchMethod("write", [$0]); |
| 466 }, enumerable: false, writable: true, configurable: true }); | 403 }, enumerable: false, writable: true, configurable: true }); |
| 467 Object.defineProperty(Object.prototype, "writeDefinition$2", { value: function($
0, $1) { | 404 Object.defineProperty(Object.prototype, "writeDefinition$2", { value: function($
0, $1) { |
| 468 return this.noSuchMethod$2("writeDefinition", [$0, $1]); | 405 return this.noSuchMethod("writeDefinition", [$0, $1]); |
| 469 }, enumerable: false, writable: true, configurable: true }); | 406 }, enumerable: false, writable: true, configurable: true }); |
| 470 // ********** Code for Clock ************** | 407 // ********** Code for Clock ************** |
| 471 function Clock() {} | 408 function Clock() {} |
| 472 Clock.now = function() { | 409 Clock.now = function() { |
| 473 return new Date().getTime(); | 410 return new Date().getTime(); |
| 474 } | 411 } |
| 475 Clock.frequency = function() { | 412 Clock.frequency = function() { |
| 476 return (1000); | 413 return (1000); |
| 477 } | 414 } |
| 478 // ********** Code for IllegalAccessException ************** | 415 // ********** Code for IllegalAccessException ************** |
| (...skipping 10 matching lines...) Expand all Loading... |
| 489 this._functionName = _functionName; | 426 this._functionName = _functionName; |
| 490 this._arguments = _arguments; | 427 this._arguments = _arguments; |
| 491 } | 428 } |
| 492 NoSuchMethodException.prototype.toString = function() { | 429 NoSuchMethodException.prototype.toString = function() { |
| 493 var sb = new StringBufferImpl(""); | 430 var sb = new StringBufferImpl(""); |
| 494 for (var i = (0); | 431 for (var i = (0); |
| 495 i < this._arguments.get$length(); i++) { | 432 i < this._arguments.get$length(); i++) { |
| 496 if (i > (0)) { | 433 if (i > (0)) { |
| 497 sb.add(", "); | 434 sb.add(", "); |
| 498 } | 435 } |
| 499 sb.add(this._arguments[i]); | 436 sb.add(this._arguments.$index(i)); |
| 500 } | 437 } |
| 501 sb.add("]"); | 438 sb.add("]"); |
| 502 return ("NoSuchMethodException - receiver: '" + this._receiver + "' ") + ("fun
ction name: '" + this._functionName + "' arguments: [" + sb + "]"); | 439 return ("NoSuchMethodException - receiver: '" + this._receiver + "' ") + ("fun
ction name: '" + this._functionName + "' arguments: [" + sb + "]"); |
| 503 } | 440 } |
| 504 NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toS
tring; | 441 NoSuchMethodException.prototype.toString$0 = NoSuchMethodException.prototype.toS
tring; |
| 505 // ********** Code for ClosureArgumentMismatchException ************** | 442 // ********** Code for ClosureArgumentMismatchException ************** |
| 506 function ClosureArgumentMismatchException() { | 443 function ClosureArgumentMismatchException() { |
| 507 | 444 |
| 508 } | 445 } |
| 509 ClosureArgumentMismatchException.prototype.toString = function() { | 446 ClosureArgumentMismatchException.prototype.toString = function() { |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 }, enumerable: false, writable: true, configurable: true }); | 656 }, enumerable: false, writable: true, configurable: true }); |
| 720 Object.defineProperty(ListFactory.prototype, "isEmpty", { value: function() { | 657 Object.defineProperty(ListFactory.prototype, "isEmpty", { value: function() { |
| 721 return this.get$length() == (0); | 658 return this.get$length() == (0); |
| 722 }, enumerable: false, writable: true, configurable: true }); | 659 }, enumerable: false, writable: true, configurable: true }); |
| 723 Object.defineProperty(ListFactory.prototype, "iterator", { value: function() { | 660 Object.defineProperty(ListFactory.prototype, "iterator", { value: function() { |
| 724 return new ListIterator(this); | 661 return new ListIterator(this); |
| 725 }, enumerable: false, writable: true, configurable: true }); | 662 }, enumerable: false, writable: true, configurable: true }); |
| 726 Object.defineProperty(ListFactory.prototype, "add$1", { value: ListFactory.proto
type.add, enumerable: false, writable: true, configurable: true }); | 663 Object.defineProperty(ListFactory.prototype, "add$1", { value: ListFactory.proto
type.add, enumerable: false, writable: true, configurable: true }); |
| 727 Object.defineProperty(ListFactory.prototype, "addAll$1", { value: ListFactory.pr
ototype.addAll, enumerable: false, writable: true, configurable: true }); | 664 Object.defineProperty(ListFactory.prototype, "addAll$1", { value: ListFactory.pr
ototype.addAll, enumerable: false, writable: true, configurable: true }); |
| 728 Object.defineProperty(ListFactory.prototype, "addLast$1", { value: ListFactory.p
rototype.addLast, enumerable: false, writable: true, configurable: true }); | 665 Object.defineProperty(ListFactory.prototype, "addLast$1", { value: ListFactory.p
rototype.addLast, enumerable: false, writable: true, configurable: true }); |
| 666 Object.defineProperty(ListFactory.prototype, "every$1", { value: function($0) { |
| 667 return this.every(to$call$1($0)); |
| 668 }, enumerable: false, writable: true, configurable: true }); |
| 729 Object.defineProperty(ListFactory.prototype, "filter$1", { value: function($0) { | 669 Object.defineProperty(ListFactory.prototype, "filter$1", { value: function($0) { |
| 730 return this.filter(to$call$1($0)); | 670 return this.filter(to$call$1($0)); |
| 731 }, enumerable: false, writable: true, configurable: true }); | 671 }, enumerable: false, writable: true, configurable: true }); |
| 732 Object.defineProperty(ListFactory.prototype, "forEach$1", { value: function($0)
{ | 672 Object.defineProperty(ListFactory.prototype, "forEach$1", { value: function($0)
{ |
| 733 return this.forEach(to$call$1($0)); | 673 return this.forEach(to$call$1($0)); |
| 734 }, enumerable: false, writable: true, configurable: true }); | 674 }, enumerable: false, writable: true, configurable: true }); |
| 675 Object.defineProperty(ListFactory.prototype, "getRange$2", { value: ListFactory.
prototype.getRange, enumerable: false, writable: true, configurable: true }); |
| 735 Object.defineProperty(ListFactory.prototype, "indexOf$1", { value: ListFactory.p
rototype.indexOf, enumerable: false, writable: true, configurable: true }); | 676 Object.defineProperty(ListFactory.prototype, "indexOf$1", { value: ListFactory.p
rototype.indexOf, enumerable: false, writable: true, configurable: true }); |
| 736 Object.defineProperty(ListFactory.prototype, "isEmpty$0", { value: ListFactory.p
rototype.isEmpty, enumerable: false, writable: true, configurable: true }); | 677 Object.defineProperty(ListFactory.prototype, "isEmpty$0", { value: ListFactory.p
rototype.isEmpty, enumerable: false, writable: true, configurable: true }); |
| 737 Object.defineProperty(ListFactory.prototype, "iterator$0", { value: ListFactory.
prototype.iterator, enumerable: false, writable: true, configurable: true }); | 678 Object.defineProperty(ListFactory.prototype, "iterator$0", { value: ListFactory.
prototype.iterator, enumerable: false, writable: true, configurable: true }); |
| 738 Object.defineProperty(ListFactory.prototype, "last$0", { value: ListFactory.prot
otype.last, enumerable: false, writable: true, configurable: true }); | 679 Object.defineProperty(ListFactory.prototype, "last$0", { value: ListFactory.prot
otype.last, enumerable: false, writable: true, configurable: true }); |
| 739 Object.defineProperty(ListFactory.prototype, "removeLast$0", { value: ListFactor
y.prototype.removeLast, enumerable: false, writable: true, configurable: true })
; | 680 Object.defineProperty(ListFactory.prototype, "removeLast$0", { value: ListFactor
y.prototype.removeLast, enumerable: false, writable: true, configurable: true })
; |
| 681 Object.defineProperty(ListFactory.prototype, "some$1", { value: function($0) { |
| 682 return this.some(to$call$1($0)); |
| 683 }, enumerable: false, writable: true, configurable: true }); |
| 740 Object.defineProperty(ListFactory.prototype, "sort$1", { value: function($0) { | 684 Object.defineProperty(ListFactory.prototype, "sort$1", { value: function($0) { |
| 741 return this.sort(to$call$2($0)); | 685 return this.sort(to$call$2($0)); |
| 742 }, enumerable: false, writable: true, configurable: true }); | 686 }, enumerable: false, writable: true, configurable: true }); |
| 743 ListFactory_E = ListFactory; | 687 ListFactory_E = ListFactory; |
| 744 ListFactory_Expression = ListFactory; | 688 ListFactory_Expression = ListFactory; |
| 745 ListFactory_K = ListFactory; | 689 ListFactory_K = ListFactory; |
| 746 ListFactory_dart_core_String = ListFactory; | 690 ListFactory_dart_core_String = ListFactory; |
| 747 ListFactory_V = ListFactory; | 691 ListFactory_V = ListFactory; |
| 748 ListFactory_VariableValue = ListFactory; | 692 ListFactory_VariableValue = ListFactory; |
| 749 ListFactory_int = ListFactory; | 693 ListFactory_int = ListFactory; |
| 750 // ********** Code for ListIterator ************** | 694 // ********** Code for ListIterator ************** |
| 751 function ListIterator(array) { | 695 function ListIterator(array) { |
| 752 this._array = array; | 696 this._array = array; |
| 753 this._pos = (0); | 697 this._pos = (0); |
| 754 } | 698 } |
| 755 ListIterator.prototype.hasNext = function() { | 699 ListIterator.prototype.hasNext = function() { |
| 756 return this._array.get$length() > this._pos; | 700 return this._array.get$length() > this._pos; |
| 757 } | 701 } |
| 758 ListIterator.prototype.next = function() { | 702 ListIterator.prototype.next = function() { |
| 759 if (!this.hasNext()) { | 703 if (!this.hasNext()) { |
| 760 $throw(const$0005); | 704 $throw(const$0005); |
| 761 } | 705 } |
| 762 return this._array[this._pos++]; | 706 return this._array.$index(this._pos++); |
| 763 } | 707 } |
| 764 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; | 708 ListIterator.prototype.hasNext$0 = ListIterator.prototype.hasNext; |
| 765 ListIterator.prototype.next$0 = ListIterator.prototype.next; | 709 ListIterator.prototype.next$0 = ListIterator.prototype.next; |
| 766 // ********** Code for ImmutableList ************** | 710 // ********** Code for ImmutableList ************** |
| 767 /** Implements extends for Dart classes on JavaScript prototypes. */ | 711 /** Implements extends for Dart classes on JavaScript prototypes. */ |
| 768 function $inherits(child, parent) { | 712 function $inherits(child, parent) { |
| 769 if (child.prototype.__proto__) { | 713 if (child.prototype.__proto__) { |
| 770 child.prototype.__proto__ = parent.prototype; | 714 child.prototype.__proto__ = parent.prototype; |
| 771 } else { | 715 } else { |
| 772 function tmp() {}; | 716 function tmp() {}; |
| 773 tmp.prototype = parent.prototype; | 717 tmp.prototype = parent.prototype; |
| 774 child.prototype = new tmp(); | 718 child.prototype = new tmp(); |
| 775 child.prototype.constructor = child; | 719 child.prototype.constructor = child; |
| 776 } | 720 } |
| 777 } | 721 } |
| 778 $inherits(ImmutableList, ListFactory_E); | 722 $inherits(ImmutableList, ListFactory_E); |
| 779 function ImmutableList(length) { | 723 function ImmutableList(length) { |
| 780 this._length = length; | 724 this._length = length; |
| 781 Array.call(this, length); | 725 Array.call(this, length); |
| 782 } | 726 } |
| 783 ImmutableList.ImmutableList$from$factory = function(other) { | 727 ImmutableList.ImmutableList$from$factory = function(other) { |
| 784 var list = new ImmutableList(other.get$length()); | 728 var list = new ImmutableList(other.get$length()); |
| 785 for (var i = (0); | 729 for (var i = (0); |
| 786 i < other.get$length(); i++) { | 730 i < other.get$length(); i++) { |
| 787 list._setindex$2(i, other[i]); | 731 list._setindex$2(i, other.$index(i)); |
| 788 } | 732 } |
| 789 return list; | 733 return list; |
| 790 } | 734 } |
| 791 ImmutableList.prototype.get$length = function() { | 735 ImmutableList.prototype.get$length = function() { |
| 792 return this._length; | 736 return this._length; |
| 793 } | 737 } |
| 794 ImmutableList.prototype.set$length = function(length) { | 738 ImmutableList.prototype.set$length = function(length) { |
| 795 $throw(const$0007); | 739 $throw(const$0007); |
| 796 } | 740 } |
| 741 Object.defineProperty(ImmutableList.prototype, "length", { |
| 742 get: ImmutableList.prototype.get$length, |
| 743 set: ImmutableList.prototype.set$length |
| 744 }); |
| 797 ImmutableList.prototype._setindex = function(index, value) { | 745 ImmutableList.prototype._setindex = function(index, value) { |
| 798 return this[index] = value; | 746 return this[index] = value; |
| 799 } | 747 } |
| 800 ImmutableList.prototype.$setindex = function(index, value) { | 748 ImmutableList.prototype.$setindex = function(index, value) { |
| 801 $throw(const$0007); | 749 $throw(const$0007); |
| 802 } | 750 } |
| 803 ImmutableList.prototype.sort = function(compare) { | 751 ImmutableList.prototype.sort = function(compare) { |
| 804 $throw(const$0007); | 752 $throw(const$0007); |
| 805 } | 753 } |
| 806 ImmutableList.prototype.add = function(element) { | 754 ImmutableList.prototype.add = function(element) { |
| 807 $throw(const$0007); | 755 $throw(const$0007); |
| 808 } | 756 } |
| 809 ImmutableList.prototype.addLast = function(element) { | 757 ImmutableList.prototype.addLast = function(element) { |
| 810 $throw(const$0007); | 758 $throw(const$0007); |
| 811 } | 759 } |
| 812 ImmutableList.prototype.addAll = function(elements) { | 760 ImmutableList.prototype.addAll = function(elements) { |
| 813 $throw(const$0007); | 761 $throw(const$0007); |
| 814 } | 762 } |
| 815 ImmutableList.prototype.clear = function() { | 763 ImmutableList.prototype.clear = function() { |
| 816 $throw(const$0007); | 764 $throw(const$0007); |
| 817 } | 765 } |
| 818 ImmutableList.prototype.removeLast = function() { | 766 ImmutableList.prototype.removeLast = function() { |
| 819 $throw(const$0007); | 767 $throw(const$0007); |
| 820 } | 768 } |
| 821 ImmutableList.prototype.toString = function() { | 769 ImmutableList.prototype.toString = function() { |
| 822 return ListFactory.ListFactory$from$factory(this).toString$0(); | 770 return ListFactory.ListFactory$from$factory(this).toString(); |
| 823 } | 771 } |
| 824 ImmutableList.prototype._setindex$2 = ImmutableList.prototype._setindex; | 772 ImmutableList.prototype._setindex$2 = ImmutableList.prototype._setindex; |
| 825 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; | 773 ImmutableList.prototype.add$1 = ImmutableList.prototype.add; |
| 826 ImmutableList.prototype.addAll$1 = ImmutableList.prototype.addAll; | 774 ImmutableList.prototype.addAll$1 = ImmutableList.prototype.addAll; |
| 827 ImmutableList.prototype.addLast$1 = ImmutableList.prototype.addLast; | 775 ImmutableList.prototype.addLast$1 = ImmutableList.prototype.addLast; |
| 828 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; | 776 ImmutableList.prototype.removeLast$0 = ImmutableList.prototype.removeLast; |
| 829 ImmutableList.prototype.sort$1 = function($0) { | 777 ImmutableList.prototype.sort$1 = function($0) { |
| 830 return this.sort(to$call$2($0)); | 778 return this.sort(to$call$2($0)); |
| 831 }; | 779 }; |
| 832 ImmutableList.prototype.toString$0 = ImmutableList.prototype.toString; | 780 ImmutableList.prototype.toString$0 = ImmutableList.prototype.toString; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 ); | 842 ); |
| 895 return result; | 843 return result; |
| 896 } | 844 } |
| 897 HashMapImplementation._computeLoadLimit = function(capacity) { | 845 HashMapImplementation._computeLoadLimit = function(capacity) { |
| 898 return $truncdiv((capacity * (3)), (4)); | 846 return $truncdiv((capacity * (3)), (4)); |
| 899 } | 847 } |
| 900 HashMapImplementation._firstProbe = function(hashCode, length) { | 848 HashMapImplementation._firstProbe = function(hashCode, length) { |
| 901 return hashCode & (length - (1)); | 849 return hashCode & (length - (1)); |
| 902 } | 850 } |
| 903 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
) { | 851 HashMapImplementation._nextProbe = function(currentProbe, numberOfProbes, length
) { |
| 904 return ($add(currentProbe, numberOfProbes)) & (length - (1)); | 852 return (currentProbe + numberOfProbes) & (length - (1)); |
| 905 } | 853 } |
| 906 HashMapImplementation.prototype._probeForAdding = function(key) { | 854 HashMapImplementation.prototype._probeForAdding = function(key) { |
| 907 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 855 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 908 var numberOfProbes = (1); | 856 var numberOfProbes = (1); |
| 909 var initialHash = hash; | 857 var initialHash = hash; |
| 910 var insertionIndex = (-1); | 858 var insertionIndex = (-1); |
| 911 while (true) { | 859 while (true) { |
| 912 var existingKey = this._keys[hash]; | 860 var existingKey = this._keys.$index(hash); |
| 913 if (existingKey == null) { | 861 if (existingKey == null) { |
| 914 if (insertionIndex < (0)) return hash; | 862 if (insertionIndex < (0)) return hash; |
| 915 return insertionIndex; | 863 return insertionIndex; |
| 916 } | 864 } |
| 917 else if ($eq(existingKey, key)) { | 865 else if ($eq(existingKey, key)) { |
| 918 return hash; | 866 return hash; |
| 919 } | 867 } |
| 920 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 868 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 921 insertionIndex = hash; | 869 insertionIndex = hash; |
| 922 } | 870 } |
| 923 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 871 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 924 } | 872 } |
| 925 } | 873 } |
| 926 HashMapImplementation.prototype._probeForLookup = function(key) { | 874 HashMapImplementation.prototype._probeForLookup = function(key) { |
| 927 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 875 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 928 var numberOfProbes = (1); | 876 var numberOfProbes = (1); |
| 929 var initialHash = hash; | 877 var initialHash = hash; |
| 930 while (true) { | 878 while (true) { |
| 931 var existingKey = this._keys[hash]; | 879 var existingKey = this._keys.$index(hash); |
| 932 if (existingKey == null) return (-1); | 880 if (existingKey == null) return (-1); |
| 933 if ($eq(existingKey, key)) return hash; | 881 if ($eq(existingKey, key)) return hash; |
| 934 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 882 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 935 } | 883 } |
| 936 } | 884 } |
| 937 HashMapImplementation.prototype._ensureCapacity = function() { | 885 HashMapImplementation.prototype._ensureCapacity = function() { |
| 938 var newNumberOfEntries = $add(this._numberOfEntries, (1)); | 886 var newNumberOfEntries = this._numberOfEntries + (1); |
| 939 if (newNumberOfEntries >= this._loadLimit) { | 887 if (newNumberOfEntries >= this._loadLimit) { |
| 940 this._grow(this._keys.get$length() * (2)); | 888 this._grow(this._keys.get$length() * (2)); |
| 941 return; | 889 return; |
| 942 } | 890 } |
| 943 var capacity = this._keys.get$length(); | 891 var capacity = this._keys.get$length(); |
| 944 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 892 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 945 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 893 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 946 if (this._numberOfDeleted > numberOfFree) { | 894 if (this._numberOfDeleted > numberOfFree) { |
| 947 this._grow(this._keys.get$length()); | 895 this._grow(this._keys.get$length()); |
| 948 } | 896 } |
| 949 } | 897 } |
| 950 HashMapImplementation._isPowerOfTwo = function(x) { | 898 HashMapImplementation._isPowerOfTwo = function(x) { |
| 951 return ((x & (x - (1))) == (0)); | 899 return ((x & (x - (1))) == (0)); |
| 952 } | 900 } |
| 953 HashMapImplementation.prototype._grow = function(newCapacity) { | 901 HashMapImplementation.prototype._grow = function(newCapacity) { |
| 954 var capacity = this._keys.get$length(); | 902 var capacity = this._keys.get$length(); |
| 955 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 903 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 956 var oldKeys = this._keys; | 904 var oldKeys = this._keys; |
| 957 var oldValues = this._values; | 905 var oldValues = this._values; |
| 958 this._keys = new Array(newCapacity); | 906 this._keys = new Array(newCapacity); |
| 959 this._values = new Array(newCapacity); | 907 this._values = new Array(newCapacity); |
| 960 for (var i = (0); | 908 for (var i = (0); |
| 961 i < capacity; i++) { | 909 i < capacity; i++) { |
| 962 var key = oldKeys[i]; | 910 var key = oldKeys.$index(i); |
| 963 if (key == null || key == const$0001) { | 911 if (key == null || key == const$0001) { |
| 964 continue; | 912 continue; |
| 965 } | 913 } |
| 966 var value = oldValues[i]; | 914 var value = oldValues.$index(i); |
| 967 var newIndex = this._probeForAdding(key); | 915 var newIndex = this._probeForAdding(key); |
| 968 this._keys.$setindex(newIndex, key); | 916 this._keys.$setindex(newIndex, key); |
| 969 this._values.$setindex(newIndex, value); | 917 this._values.$setindex(newIndex, value); |
| 970 } | 918 } |
| 971 this._numberOfDeleted = (0); | 919 this._numberOfDeleted = (0); |
| 972 } | 920 } |
| 973 HashMapImplementation.prototype.$setindex = function(key, value) { | 921 HashMapImplementation.prototype.$setindex = function(key, value) { |
| 974 this._ensureCapacity(); | 922 this._ensureCapacity(); |
| 975 var index = this._probeForAdding(key); | 923 var index = this._probeForAdding(key); |
| 976 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { | 924 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0
001)) { |
| 977 this._numberOfEntries++; | 925 this._numberOfEntries++; |
| 978 } | 926 } |
| 979 this._keys.$setindex(index, key); | 927 this._keys.$setindex(index, key); |
| 980 this._values.$setindex(index, value); | 928 this._values.$setindex(index, value); |
| 981 } | 929 } |
| 982 HashMapImplementation.prototype.$index = function(key) { | 930 HashMapImplementation.prototype.$index = function(key) { |
| 983 var index = this._probeForLookup(key); | 931 var index = this._probeForLookup(key); |
| 984 if (index < (0)) return null; | 932 if (index < (0)) return null; |
| 985 return this._values[index]; | 933 return this._values.$index(index); |
| 986 } | 934 } |
| 987 HashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { | 935 HashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { |
| 988 var index = this._probeForLookup(key); | 936 var index = this._probeForLookup(key); |
| 989 if (index >= (0)) return this._values[index]; | 937 if (index >= (0)) return this._values.$index(index); |
| 990 var value = ifAbsent.call$0(); | 938 var value = ifAbsent(); |
| 991 this.$setindex(key, value); | 939 this.$setindex(key, value); |
| 992 return value; | 940 return value; |
| 993 } | 941 } |
| 942 HashMapImplementation.prototype.remove = function(key) { |
| 943 var index = this._probeForLookup(key); |
| 944 if (index >= (0)) { |
| 945 this._numberOfEntries--; |
| 946 var value = this._values.$index(index); |
| 947 this._values.$setindex(index); |
| 948 this._keys.$setindex(index, const$0001); |
| 949 this._numberOfDeleted++; |
| 950 return value; |
| 951 } |
| 952 return null; |
| 953 } |
| 994 HashMapImplementation.prototype.isEmpty = function() { | 954 HashMapImplementation.prototype.isEmpty = function() { |
| 995 return this._numberOfEntries == (0); | 955 return this._numberOfEntries == (0); |
| 996 } | 956 } |
| 997 HashMapImplementation.prototype.get$length = function() { | 957 HashMapImplementation.prototype.get$length = function() { |
| 998 return this._numberOfEntries; | 958 return this._numberOfEntries; |
| 999 } | 959 } |
| 1000 HashMapImplementation.prototype.forEach = function(f) { | 960 HashMapImplementation.prototype.forEach = function(f) { |
| 1001 var length = this._keys.get$length(); | 961 var length = this._keys.get$length(); |
| 1002 for (var i = (0); | 962 for (var i = (0); |
| 1003 i < length; i++) { | 963 i < length; i++) { |
| 1004 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { | 964 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001))
{ |
| 1005 f.call$2(this._keys[i], this._values[i]); | 965 f(this._keys.$index(i), this._values.$index(i)); |
| 1006 } | 966 } |
| 1007 } | 967 } |
| 1008 } | 968 } |
| 1009 HashMapImplementation.prototype.getKeys = function() { | 969 HashMapImplementation.prototype.getKeys = function() { |
| 1010 var list = new Array(this.get$length()); | 970 var list = new Array(this.get$length()); |
| 1011 var i = (0); | 971 var i = (0); |
| 1012 this.forEach(function _(key, value) { | 972 this.forEach(function _(key, value) { |
| 1013 list.$setindex(i++, key); | 973 list.$setindex(i++, key); |
| 1014 } | 974 } |
| 1015 ); | 975 ); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 1027 HashMapImplementation.prototype.containsKey = function(key) { | 987 HashMapImplementation.prototype.containsKey = function(key) { |
| 1028 return (this._probeForLookup(key) != (-1)); | 988 return (this._probeForLookup(key) != (-1)); |
| 1029 } | 989 } |
| 1030 HashMapImplementation.prototype.containsKey$1 = HashMapImplementation.prototype.
containsKey; | 990 HashMapImplementation.prototype.containsKey$1 = HashMapImplementation.prototype.
containsKey; |
| 1031 HashMapImplementation.prototype.forEach$1 = function($0) { | 991 HashMapImplementation.prototype.forEach$1 = function($0) { |
| 1032 return this.forEach(to$call$2($0)); | 992 return this.forEach(to$call$2($0)); |
| 1033 }; | 993 }; |
| 1034 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK
eys; | 994 HashMapImplementation.prototype.getKeys$0 = HashMapImplementation.prototype.getK
eys; |
| 1035 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge
tValues; | 995 HashMapImplementation.prototype.getValues$0 = HashMapImplementation.prototype.ge
tValues; |
| 1036 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm
pty; | 996 HashMapImplementation.prototype.isEmpty$0 = HashMapImplementation.prototype.isEm
pty; |
| 997 HashMapImplementation.prototype.putIfAbsent$2 = function($0, $1) { |
| 998 return this.putIfAbsent($0, to$call$0($1)); |
| 999 }; |
| 1037 // ********** Code for HashMapImplementation_E$E ************** | 1000 // ********** Code for HashMapImplementation_E$E ************** |
| 1038 $inherits(HashMapImplementation_E$E, HashMapImplementation); | 1001 $inherits(HashMapImplementation_E$E, HashMapImplementation); |
| 1039 function HashMapImplementation_E$E() { | 1002 function HashMapImplementation_E$E() { |
| 1040 this._numberOfEntries = (0); | 1003 this._numberOfEntries = (0); |
| 1041 this._numberOfDeleted = (0); | 1004 this._numberOfDeleted = (0); |
| 1042 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); | 1005 this._loadLimit = HashMapImplementation._computeLoadLimit((8)); |
| 1043 this._keys = new Array((8)); | 1006 this._keys = new Array((8)); |
| 1044 this._values = new Array((8)); | 1007 this._values = new Array((8)); |
| 1045 } | 1008 } |
| 1046 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { | 1009 HashMapImplementation_E$E._computeLoadLimit = function(capacity) { |
| 1047 return $truncdiv((capacity * (3)), (4)); | 1010 return $truncdiv((capacity * (3)), (4)); |
| 1048 } | 1011 } |
| 1049 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { | 1012 HashMapImplementation_E$E._firstProbe = function(hashCode, length) { |
| 1050 return hashCode & (length - (1)); | 1013 return hashCode & (length - (1)); |
| 1051 } | 1014 } |
| 1052 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { | 1015 HashMapImplementation_E$E._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { |
| 1053 return ($add(currentProbe, numberOfProbes)) & (length - (1)); | 1016 return (currentProbe + numberOfProbes) & (length - (1)); |
| 1054 } | 1017 } |
| 1055 HashMapImplementation_E$E.prototype._probeForAdding = function(key) { | 1018 HashMapImplementation_E$E.prototype._probeForAdding = function(key) { |
| 1056 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 1019 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 1057 var numberOfProbes = (1); | 1020 var numberOfProbes = (1); |
| 1058 var initialHash = hash; | 1021 var initialHash = hash; |
| 1059 var insertionIndex = (-1); | 1022 var insertionIndex = (-1); |
| 1060 while (true) { | 1023 while (true) { |
| 1061 var existingKey = this._keys[hash]; | 1024 var existingKey = this._keys.$index(hash); |
| 1062 if (existingKey == null) { | 1025 if (existingKey == null) { |
| 1063 if (insertionIndex < (0)) return hash; | 1026 if (insertionIndex < (0)) return hash; |
| 1064 return insertionIndex; | 1027 return insertionIndex; |
| 1065 } | 1028 } |
| 1066 else if ($eq(existingKey, key)) { | 1029 else if ($eq(existingKey, key)) { |
| 1067 return hash; | 1030 return hash; |
| 1068 } | 1031 } |
| 1069 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1032 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1070 insertionIndex = hash; | 1033 insertionIndex = hash; |
| 1071 } | 1034 } |
| 1072 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1035 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1073 } | 1036 } |
| 1074 } | 1037 } |
| 1075 HashMapImplementation_E$E.prototype._probeForLookup = function(key) { | 1038 HashMapImplementation_E$E.prototype._probeForLookup = function(key) { |
| 1076 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 1039 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 1077 var numberOfProbes = (1); | 1040 var numberOfProbes = (1); |
| 1078 var initialHash = hash; | 1041 var initialHash = hash; |
| 1079 while (true) { | 1042 while (true) { |
| 1080 var existingKey = this._keys[hash]; | 1043 var existingKey = this._keys.$index(hash); |
| 1081 if (existingKey == null) return (-1); | 1044 if (existingKey == null) return (-1); |
| 1082 if ($eq(existingKey, key)) return hash; | 1045 if ($eq(existingKey, key)) return hash; |
| 1083 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1046 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1084 } | 1047 } |
| 1085 } | 1048 } |
| 1086 HashMapImplementation_E$E.prototype._ensureCapacity = function() { | 1049 HashMapImplementation_E$E.prototype._ensureCapacity = function() { |
| 1087 var newNumberOfEntries = $add(this._numberOfEntries, (1)); | 1050 var newNumberOfEntries = this._numberOfEntries + (1); |
| 1088 if (newNumberOfEntries >= this._loadLimit) { | 1051 if (newNumberOfEntries >= this._loadLimit) { |
| 1089 this._grow(this._keys.get$length() * (2)); | 1052 this._grow(this._keys.get$length() * (2)); |
| 1090 return; | 1053 return; |
| 1091 } | 1054 } |
| 1092 var capacity = this._keys.get$length(); | 1055 var capacity = this._keys.get$length(); |
| 1093 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1056 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 1094 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1057 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 1095 if (this._numberOfDeleted > numberOfFree) { | 1058 if (this._numberOfDeleted > numberOfFree) { |
| 1096 this._grow(this._keys.get$length()); | 1059 this._grow(this._keys.get$length()); |
| 1097 } | 1060 } |
| 1098 } | 1061 } |
| 1099 HashMapImplementation_E$E._isPowerOfTwo = function(x) { | 1062 HashMapImplementation_E$E._isPowerOfTwo = function(x) { |
| 1100 return ((x & (x - (1))) == (0)); | 1063 return ((x & (x - (1))) == (0)); |
| 1101 } | 1064 } |
| 1102 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { | 1065 HashMapImplementation_E$E.prototype._grow = function(newCapacity) { |
| 1103 var capacity = this._keys.get$length(); | 1066 var capacity = this._keys.get$length(); |
| 1104 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1067 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1105 var oldKeys = this._keys; | 1068 var oldKeys = this._keys; |
| 1106 var oldValues = this._values; | 1069 var oldValues = this._values; |
| 1107 this._keys = new Array(newCapacity); | 1070 this._keys = new Array(newCapacity); |
| 1108 this._values = new Array(newCapacity); | 1071 this._values = new Array(newCapacity); |
| 1109 for (var i = (0); | 1072 for (var i = (0); |
| 1110 i < capacity; i++) { | 1073 i < capacity; i++) { |
| 1111 var key = oldKeys[i]; | 1074 var key = oldKeys.$index(i); |
| 1112 if (key == null || key == const$0001) { | 1075 if (key == null || key == const$0001) { |
| 1113 continue; | 1076 continue; |
| 1114 } | 1077 } |
| 1115 var value = oldValues[i]; | 1078 var value = oldValues.$index(i); |
| 1116 var newIndex = this._probeForAdding(key); | 1079 var newIndex = this._probeForAdding(key); |
| 1117 this._keys.$setindex(newIndex, key); | 1080 this._keys.$setindex(newIndex, key); |
| 1118 this._values.$setindex(newIndex, value); | 1081 this._values.$setindex(newIndex, value); |
| 1119 } | 1082 } |
| 1120 this._numberOfDeleted = (0); | 1083 this._numberOfDeleted = (0); |
| 1121 } | 1084 } |
| 1122 HashMapImplementation_E$E.prototype.$setindex = function(key, value) { | 1085 HashMapImplementation_E$E.prototype.$setindex = function(key, value) { |
| 1123 this._ensureCapacity(); | 1086 this._ensureCapacity(); |
| 1124 var index = this._probeForAdding(key); | 1087 var index = this._probeForAdding(key); |
| 1125 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { | 1088 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0
001)) { |
| 1126 this._numberOfEntries++; | 1089 this._numberOfEntries++; |
| 1127 } | 1090 } |
| 1128 this._keys.$setindex(index, key); | 1091 this._keys.$setindex(index, key); |
| 1129 this._values.$setindex(index, value); | 1092 this._values.$setindex(index, value); |
| 1130 } | 1093 } |
| 1094 HashMapImplementation_E$E.prototype.remove = function(key) { |
| 1095 var index = this._probeForLookup(key); |
| 1096 if (index >= (0)) { |
| 1097 this._numberOfEntries--; |
| 1098 var value = this._values.$index(index); |
| 1099 this._values.$setindex(index); |
| 1100 this._keys.$setindex(index, const$0001); |
| 1101 this._numberOfDeleted++; |
| 1102 return value; |
| 1103 } |
| 1104 return null; |
| 1105 } |
| 1131 HashMapImplementation_E$E.prototype.isEmpty = function() { | 1106 HashMapImplementation_E$E.prototype.isEmpty = function() { |
| 1132 return this._numberOfEntries == (0); | 1107 return this._numberOfEntries == (0); |
| 1133 } | 1108 } |
| 1134 HashMapImplementation_E$E.prototype.forEach = function(f) { | 1109 HashMapImplementation_E$E.prototype.forEach = function(f) { |
| 1135 var length = this._keys.get$length(); | 1110 var length = this._keys.get$length(); |
| 1136 for (var i = (0); | 1111 for (var i = (0); |
| 1137 i < length; i++) { | 1112 i < length; i++) { |
| 1138 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { | 1113 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001))
{ |
| 1139 f.call$2(this._keys[i], this._values[i]); | 1114 f(this._keys.$index(i), this._values.$index(i)); |
| 1140 } | 1115 } |
| 1141 } | 1116 } |
| 1142 } | 1117 } |
| 1143 HashMapImplementation_E$E.prototype.getKeys = function() { | 1118 HashMapImplementation_E$E.prototype.getKeys = function() { |
| 1144 var list = new Array(this.get$length()); | 1119 var list = new Array(this.get$length()); |
| 1145 var i = (0); | 1120 var i = (0); |
| 1146 this.forEach(function _(key, value) { | 1121 this.forEach(function _(key, value) { |
| 1147 list.$setindex(i++, key); | 1122 list.$setindex(i++, key); |
| 1148 } | 1123 } |
| 1149 ); | 1124 ); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1164 this._keys = new Array((8)); | 1139 this._keys = new Array((8)); |
| 1165 this._values = new Array((8)); | 1140 this._values = new Array((8)); |
| 1166 } | 1141 } |
| 1167 HashMapImplementation_K$V._computeLoadLimit = function(capacity) { | 1142 HashMapImplementation_K$V._computeLoadLimit = function(capacity) { |
| 1168 return $truncdiv((capacity * (3)), (4)); | 1143 return $truncdiv((capacity * (3)), (4)); |
| 1169 } | 1144 } |
| 1170 HashMapImplementation_K$V._firstProbe = function(hashCode, length) { | 1145 HashMapImplementation_K$V._firstProbe = function(hashCode, length) { |
| 1171 return hashCode & (length - (1)); | 1146 return hashCode & (length - (1)); |
| 1172 } | 1147 } |
| 1173 HashMapImplementation_K$V._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { | 1148 HashMapImplementation_K$V._nextProbe = function(currentProbe, numberOfProbes, le
ngth) { |
| 1174 return ($add(currentProbe, numberOfProbes)) & (length - (1)); | 1149 return (currentProbe + numberOfProbes) & (length - (1)); |
| 1175 } | 1150 } |
| 1176 HashMapImplementation_K$V.prototype._probeForAdding = function(key) { | 1151 HashMapImplementation_K$V.prototype._probeForAdding = function(key) { |
| 1177 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 1152 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 1178 var numberOfProbes = (1); | 1153 var numberOfProbes = (1); |
| 1179 var initialHash = hash; | 1154 var initialHash = hash; |
| 1180 var insertionIndex = (-1); | 1155 var insertionIndex = (-1); |
| 1181 while (true) { | 1156 while (true) { |
| 1182 var existingKey = this._keys[hash]; | 1157 var existingKey = this._keys.$index(hash); |
| 1183 if (existingKey == null) { | 1158 if (existingKey == null) { |
| 1184 if (insertionIndex < (0)) return hash; | 1159 if (insertionIndex < (0)) return hash; |
| 1185 return insertionIndex; | 1160 return insertionIndex; |
| 1186 } | 1161 } |
| 1187 else if ($eq(existingKey, key)) { | 1162 else if ($eq(existingKey, key)) { |
| 1188 return hash; | 1163 return hash; |
| 1189 } | 1164 } |
| 1190 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1165 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1191 insertionIndex = hash; | 1166 insertionIndex = hash; |
| 1192 } | 1167 } |
| 1193 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1168 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1194 } | 1169 } |
| 1195 } | 1170 } |
| 1196 HashMapImplementation_K$V.prototype._probeForLookup = function(key) { | 1171 HashMapImplementation_K$V.prototype._probeForLookup = function(key) { |
| 1197 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); | 1172 var hash = HashMapImplementation._firstProbe(key.hashCode$0(), this._keys.get$
length()); |
| 1198 var numberOfProbes = (1); | 1173 var numberOfProbes = (1); |
| 1199 var initialHash = hash; | 1174 var initialHash = hash; |
| 1200 while (true) { | 1175 while (true) { |
| 1201 var existingKey = this._keys[hash]; | 1176 var existingKey = this._keys.$index(hash); |
| 1202 if (existingKey == null) return (-1); | 1177 if (existingKey == null) return (-1); |
| 1203 if ($eq(existingKey, key)) return hash; | 1178 if ($eq(existingKey, key)) return hash; |
| 1204 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1179 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1205 } | 1180 } |
| 1206 } | 1181 } |
| 1207 HashMapImplementation_K$V.prototype._ensureCapacity = function() { | 1182 HashMapImplementation_K$V.prototype._ensureCapacity = function() { |
| 1208 var newNumberOfEntries = $add(this._numberOfEntries, (1)); | 1183 var newNumberOfEntries = this._numberOfEntries + (1); |
| 1209 if (newNumberOfEntries >= this._loadLimit) { | 1184 if (newNumberOfEntries >= this._loadLimit) { |
| 1210 this._grow(this._keys.get$length() * (2)); | 1185 this._grow(this._keys.get$length() * (2)); |
| 1211 return; | 1186 return; |
| 1212 } | 1187 } |
| 1213 var capacity = this._keys.get$length(); | 1188 var capacity = this._keys.get$length(); |
| 1214 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1189 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 1215 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1190 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 1216 if (this._numberOfDeleted > numberOfFree) { | 1191 if (this._numberOfDeleted > numberOfFree) { |
| 1217 this._grow(this._keys.get$length()); | 1192 this._grow(this._keys.get$length()); |
| 1218 } | 1193 } |
| 1219 } | 1194 } |
| 1220 HashMapImplementation_K$V._isPowerOfTwo = function(x) { | 1195 HashMapImplementation_K$V._isPowerOfTwo = function(x) { |
| 1221 return ((x & (x - (1))) == (0)); | 1196 return ((x & (x - (1))) == (0)); |
| 1222 } | 1197 } |
| 1223 HashMapImplementation_K$V.prototype._grow = function(newCapacity) { | 1198 HashMapImplementation_K$V.prototype._grow = function(newCapacity) { |
| 1224 var capacity = this._keys.get$length(); | 1199 var capacity = this._keys.get$length(); |
| 1225 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1200 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1226 var oldKeys = this._keys; | 1201 var oldKeys = this._keys; |
| 1227 var oldValues = this._values; | 1202 var oldValues = this._values; |
| 1228 this._keys = new Array(newCapacity); | 1203 this._keys = new Array(newCapacity); |
| 1229 this._values = new Array(newCapacity); | 1204 this._values = new Array(newCapacity); |
| 1230 for (var i = (0); | 1205 for (var i = (0); |
| 1231 i < capacity; i++) { | 1206 i < capacity; i++) { |
| 1232 var key = oldKeys[i]; | 1207 var key = oldKeys.$index(i); |
| 1233 if (key == null || key == const$0001) { | 1208 if (key == null || key == const$0001) { |
| 1234 continue; | 1209 continue; |
| 1235 } | 1210 } |
| 1236 var value = oldValues[i]; | 1211 var value = oldValues.$index(i); |
| 1237 var newIndex = this._probeForAdding(key); | 1212 var newIndex = this._probeForAdding(key); |
| 1238 this._keys.$setindex(newIndex, key); | 1213 this._keys.$setindex(newIndex, key); |
| 1239 this._values.$setindex(newIndex, value); | 1214 this._values.$setindex(newIndex, value); |
| 1240 } | 1215 } |
| 1241 this._numberOfDeleted = (0); | 1216 this._numberOfDeleted = (0); |
| 1242 } | 1217 } |
| 1243 HashMapImplementation_K$V.prototype.$setindex = function(key, value) { | 1218 HashMapImplementation_K$V.prototype.$setindex = function(key, value) { |
| 1244 this._ensureCapacity(); | 1219 this._ensureCapacity(); |
| 1245 var index = this._probeForAdding(key); | 1220 var index = this._probeForAdding(key); |
| 1246 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { | 1221 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0
001)) { |
| 1247 this._numberOfEntries++; | 1222 this._numberOfEntries++; |
| 1248 } | 1223 } |
| 1249 this._keys.$setindex(index, key); | 1224 this._keys.$setindex(index, key); |
| 1250 this._values.$setindex(index, value); | 1225 this._values.$setindex(index, value); |
| 1251 } | 1226 } |
| 1252 HashMapImplementation_K$V.prototype.$index = function(key) { | 1227 HashMapImplementation_K$V.prototype.$index = function(key) { |
| 1253 var index = this._probeForLookup(key); | 1228 var index = this._probeForLookup(key); |
| 1254 if (index < (0)) return null; | 1229 if (index < (0)) return null; |
| 1255 return this._values[index]; | 1230 return this._values.$index(index); |
| 1256 } | 1231 } |
| 1257 HashMapImplementation_K$V.prototype.putIfAbsent = function(key, ifAbsent) { | 1232 HashMapImplementation_K$V.prototype.putIfAbsent = function(key, ifAbsent) { |
| 1258 var index = this._probeForLookup(key); | 1233 var index = this._probeForLookup(key); |
| 1259 if (index >= (0)) return this._values[index]; | 1234 if (index >= (0)) return this._values.$index(index); |
| 1260 var value = ifAbsent.call$0(); | 1235 var value = ifAbsent(); |
| 1261 this.$setindex(key, value); | 1236 this.$setindex(key, value); |
| 1262 return value; | 1237 return value; |
| 1263 } | 1238 } |
| 1264 HashMapImplementation_K$V.prototype.isEmpty = function() { | 1239 HashMapImplementation_K$V.prototype.isEmpty = function() { |
| 1265 return this._numberOfEntries == (0); | 1240 return this._numberOfEntries == (0); |
| 1266 } | 1241 } |
| 1267 HashMapImplementation_K$V.prototype.forEach = function(f) { | 1242 HashMapImplementation_K$V.prototype.forEach = function(f) { |
| 1268 var length = this._keys.get$length(); | 1243 var length = this._keys.get$length(); |
| 1269 for (var i = (0); | 1244 for (var i = (0); |
| 1270 i < length; i++) { | 1245 i < length; i++) { |
| 1271 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { | 1246 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001))
{ |
| 1272 f.call$2(this._keys[i], this._values[i]); | 1247 f(this._keys.$index(i), this._values.$index(i)); |
| 1273 } | 1248 } |
| 1274 } | 1249 } |
| 1275 } | 1250 } |
| 1276 HashMapImplementation_K$V.prototype.getKeys = function() { | 1251 HashMapImplementation_K$V.prototype.getKeys = function() { |
| 1277 var list = new Array(this.get$length()); | 1252 var list = new Array(this.get$length()); |
| 1278 var i = (0); | 1253 var i = (0); |
| 1279 this.forEach(function _(key, value) { | 1254 this.forEach(function _(key, value) { |
| 1280 list.$setindex(i++, key); | 1255 list.$setindex(i++, key); |
| 1281 } | 1256 } |
| 1282 ); | 1257 ); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1303 this._keys = new Array((8)); | 1278 this._keys = new Array((8)); |
| 1304 this._values = new Array((8)); | 1279 this._values = new Array((8)); |
| 1305 } | 1280 } |
| 1306 HashMapImplementation_dart_core_String$VariableValue._computeLoadLimit = functio
n(capacity) { | 1281 HashMapImplementation_dart_core_String$VariableValue._computeLoadLimit = functio
n(capacity) { |
| 1307 return $truncdiv((capacity * (3)), (4)); | 1282 return $truncdiv((capacity * (3)), (4)); |
| 1308 } | 1283 } |
| 1309 HashMapImplementation_dart_core_String$VariableValue._firstProbe = function(hash
Code, length) { | 1284 HashMapImplementation_dart_core_String$VariableValue._firstProbe = function(hash
Code, length) { |
| 1310 return hashCode & (length - (1)); | 1285 return hashCode & (length - (1)); |
| 1311 } | 1286 } |
| 1312 HashMapImplementation_dart_core_String$VariableValue._nextProbe = function(curre
ntProbe, numberOfProbes, length) { | 1287 HashMapImplementation_dart_core_String$VariableValue._nextProbe = function(curre
ntProbe, numberOfProbes, length) { |
| 1313 return ($add(currentProbe, numberOfProbes)) & (length - (1)); | 1288 return (currentProbe + numberOfProbes) & (length - (1)); |
| 1314 } | 1289 } |
| 1315 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForAdding =
function(key) { | 1290 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForAdding =
function(key) { |
| 1316 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le
ngth()); | 1291 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le
ngth()); |
| 1317 var numberOfProbes = (1); | 1292 var numberOfProbes = (1); |
| 1318 var initialHash = hash; | 1293 var initialHash = hash; |
| 1319 var insertionIndex = (-1); | 1294 var insertionIndex = (-1); |
| 1320 while (true) { | 1295 while (true) { |
| 1321 var existingKey = this._keys[hash]; | 1296 var existingKey = this._keys.$index(hash); |
| 1322 if (existingKey == null) { | 1297 if (existingKey == null) { |
| 1323 if (insertionIndex < (0)) return hash; | 1298 if (insertionIndex < (0)) return hash; |
| 1324 return insertionIndex; | 1299 return insertionIndex; |
| 1325 } | 1300 } |
| 1326 else if ($eq(existingKey, key)) { | 1301 else if ($eq(existingKey, key)) { |
| 1327 return hash; | 1302 return hash; |
| 1328 } | 1303 } |
| 1329 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { | 1304 else if ((insertionIndex < (0)) && (const$0001 == existingKey)) { |
| 1330 insertionIndex = hash; | 1305 insertionIndex = hash; |
| 1331 } | 1306 } |
| 1332 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1307 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1333 } | 1308 } |
| 1334 } | 1309 } |
| 1335 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForLookup =
function(key) { | 1310 HashMapImplementation_dart_core_String$VariableValue.prototype._probeForLookup =
function(key) { |
| 1336 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le
ngth()); | 1311 var hash = HashMapImplementation._firstProbe(key.hashCode(), this._keys.get$le
ngth()); |
| 1337 var numberOfProbes = (1); | 1312 var numberOfProbes = (1); |
| 1338 var initialHash = hash; | 1313 var initialHash = hash; |
| 1339 while (true) { | 1314 while (true) { |
| 1340 var existingKey = this._keys[hash]; | 1315 var existingKey = this._keys.$index(hash); |
| 1341 if (existingKey == null) return (-1); | 1316 if (existingKey == null) return (-1); |
| 1342 if ($eq(existingKey, key)) return hash; | 1317 if ($eq(existingKey, key)) return hash; |
| 1343 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); | 1318 hash = HashMapImplementation._nextProbe(hash, numberOfProbes++, this._keys.g
et$length()); |
| 1344 } | 1319 } |
| 1345 } | 1320 } |
| 1346 HashMapImplementation_dart_core_String$VariableValue.prototype._ensureCapacity =
function() { | 1321 HashMapImplementation_dart_core_String$VariableValue.prototype._ensureCapacity =
function() { |
| 1347 var newNumberOfEntries = $add(this._numberOfEntries, (1)); | 1322 var newNumberOfEntries = this._numberOfEntries + (1); |
| 1348 if (newNumberOfEntries >= this._loadLimit) { | 1323 if (newNumberOfEntries >= this._loadLimit) { |
| 1349 this._grow(this._keys.get$length() * (2)); | 1324 this._grow(this._keys.get$length() * (2)); |
| 1350 return; | 1325 return; |
| 1351 } | 1326 } |
| 1352 var capacity = this._keys.get$length(); | 1327 var capacity = this._keys.get$length(); |
| 1353 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; | 1328 var numberOfFreeOrDeleted = capacity - newNumberOfEntries; |
| 1354 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; | 1329 var numberOfFree = numberOfFreeOrDeleted - this._numberOfDeleted; |
| 1355 if (this._numberOfDeleted > numberOfFree) { | 1330 if (this._numberOfDeleted > numberOfFree) { |
| 1356 this._grow(this._keys.get$length()); | 1331 this._grow(this._keys.get$length()); |
| 1357 } | 1332 } |
| 1358 } | 1333 } |
| 1359 HashMapImplementation_dart_core_String$VariableValue._isPowerOfTwo = function(x)
{ | 1334 HashMapImplementation_dart_core_String$VariableValue._isPowerOfTwo = function(x)
{ |
| 1360 return ((x & (x - (1))) == (0)); | 1335 return ((x & (x - (1))) == (0)); |
| 1361 } | 1336 } |
| 1362 HashMapImplementation_dart_core_String$VariableValue.prototype._grow = function(
newCapacity) { | 1337 HashMapImplementation_dart_core_String$VariableValue.prototype._grow = function(
newCapacity) { |
| 1363 var capacity = this._keys.get$length(); | 1338 var capacity = this._keys.get$length(); |
| 1364 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); | 1339 this._loadLimit = HashMapImplementation._computeLoadLimit(newCapacity); |
| 1365 var oldKeys = this._keys; | 1340 var oldKeys = this._keys; |
| 1366 var oldValues = this._values; | 1341 var oldValues = this._values; |
| 1367 this._keys = new Array(newCapacity); | 1342 this._keys = new Array(newCapacity); |
| 1368 this._values = new Array(newCapacity); | 1343 this._values = new Array(newCapacity); |
| 1369 for (var i = (0); | 1344 for (var i = (0); |
| 1370 i < capacity; i++) { | 1345 i < capacity; i++) { |
| 1371 var key = oldKeys[i]; | 1346 var key = oldKeys.$index(i); |
| 1372 if (key == null || key == const$0001) { | 1347 if (key == null || key == const$0001) { |
| 1373 continue; | 1348 continue; |
| 1374 } | 1349 } |
| 1375 var value = oldValues[i]; | 1350 var value = oldValues.$index(i); |
| 1376 var newIndex = this._probeForAdding(key); | 1351 var newIndex = this._probeForAdding(key); |
| 1377 this._keys.$setindex(newIndex, key); | 1352 this._keys.$setindex(newIndex, key); |
| 1378 this._values.$setindex(newIndex, value); | 1353 this._values.$setindex(newIndex, value); |
| 1379 } | 1354 } |
| 1380 this._numberOfDeleted = (0); | 1355 this._numberOfDeleted = (0); |
| 1381 } | 1356 } |
| 1382 HashMapImplementation_dart_core_String$VariableValue.prototype.$setindex = funct
ion(key, value) { | 1357 HashMapImplementation_dart_core_String$VariableValue.prototype.$setindex = funct
ion(key, value) { |
| 1383 this._ensureCapacity(); | 1358 this._ensureCapacity(); |
| 1384 var index = this._probeForAdding(key); | 1359 var index = this._probeForAdding(key); |
| 1385 if ((this._keys[index] == null) || (this._keys[index] == const$0001)) { | 1360 if ((this._keys.$index(index) == null) || (this._keys.$index(index) == const$0
001)) { |
| 1386 this._numberOfEntries++; | 1361 this._numberOfEntries++; |
| 1387 } | 1362 } |
| 1388 this._keys.$setindex(index, key); | 1363 this._keys.$setindex(index, key); |
| 1389 this._values.$setindex(index, value); | 1364 this._values.$setindex(index, value); |
| 1390 } | 1365 } |
| 1391 HashMapImplementation_dart_core_String$VariableValue.prototype.$index = function
(key) { | 1366 HashMapImplementation_dart_core_String$VariableValue.prototype.$index = function
(key) { |
| 1392 var index = this._probeForLookup(key); | 1367 var index = this._probeForLookup(key); |
| 1393 if (index < (0)) return null; | 1368 if (index < (0)) return null; |
| 1394 return this._values[index]; | 1369 return this._values.$index(index); |
| 1395 } | 1370 } |
| 1396 HashMapImplementation_dart_core_String$VariableValue.prototype.forEach = functio
n(f) { | 1371 HashMapImplementation_dart_core_String$VariableValue.prototype.forEach = functio
n(f) { |
| 1397 var length = this._keys.get$length(); | 1372 var length = this._keys.get$length(); |
| 1398 for (var i = (0); | 1373 for (var i = (0); |
| 1399 i < length; i++) { | 1374 i < length; i++) { |
| 1400 if ((this._keys[i] != null) && (this._keys[i] != const$0001)) { | 1375 if ((this._keys.$index(i) != null) && (this._keys.$index(i) != const$0001))
{ |
| 1401 f.call$2(this._keys[i], this._values[i]); | 1376 f(this._keys.$index(i), this._values.$index(i)); |
| 1402 } | 1377 } |
| 1403 } | 1378 } |
| 1404 } | 1379 } |
| 1405 HashMapImplementation_dart_core_String$VariableValue.prototype.containsKey = fun
ction(key) { | 1380 HashMapImplementation_dart_core_String$VariableValue.prototype.containsKey = fun
ction(key) { |
| 1406 return (this._probeForLookup(key) != (-1)); | 1381 return (this._probeForLookup(key) != (-1)); |
| 1407 } | 1382 } |
| 1408 // ********** Code for HashSetImplementation ************** | 1383 // ********** Code for HashSetImplementation ************** |
| 1409 function HashSetImplementation() { | 1384 function HashSetImplementation() { |
| 1410 this._backingMap = new HashMapImplementation_E$E(); | 1385 this._backingMap = new HashMapImplementation_E$E(); |
| 1411 } | 1386 } |
| 1412 HashSetImplementation.HashSetImplementation$from$factory = function(other) { | 1387 HashSetImplementation.HashSetImplementation$from$factory = function(other) { |
| 1413 var set = new HashSetImplementation_E(); | 1388 var set = new HashSetImplementation_E(); |
| 1414 for (var $$i = other.iterator$0(); $$i.hasNext$0(); ) { | 1389 for (var $$i = other.iterator$0(); $$i.hasNext$0(); ) { |
| 1415 var e = $$i.next$0(); | 1390 var e = $$i.next$0(); |
| 1416 set.add(e); | 1391 set.add(e); |
| 1417 } | 1392 } |
| 1418 return set; | 1393 return set; |
| 1419 } | 1394 } |
| 1420 HashSetImplementation.prototype.add = function(value) { | 1395 HashSetImplementation.prototype.add = function(value) { |
| 1421 this._backingMap.$setindex(value, value); | 1396 this._backingMap.$setindex(value, value); |
| 1422 } | 1397 } |
| 1423 HashSetImplementation.prototype.contains = function(value) { | 1398 HashSetImplementation.prototype.contains = function(value) { |
| 1424 return this._backingMap.containsKey(value); | 1399 return this._backingMap.containsKey(value); |
| 1425 } | 1400 } |
| 1401 HashSetImplementation.prototype.remove = function(value) { |
| 1402 if (!this._backingMap.containsKey(value)) return false; |
| 1403 this._backingMap.remove(value); |
| 1404 return true; |
| 1405 } |
| 1426 HashSetImplementation.prototype.addAll = function(collection) { | 1406 HashSetImplementation.prototype.addAll = function(collection) { |
| 1427 var $this = this; // closure support | 1407 var $this = this; // closure support |
| 1428 collection.forEach(function _(value) { | 1408 collection.forEach(function _(value) { |
| 1429 $this.add(value); | 1409 $this.add(value); |
| 1430 } | 1410 } |
| 1431 ); | 1411 ); |
| 1432 } | 1412 } |
| 1433 HashSetImplementation.prototype.forEach = function(f) { | 1413 HashSetImplementation.prototype.forEach = function(f) { |
| 1434 this._backingMap.forEach(function _(key, value) { | 1414 this._backingMap.forEach(function _(key, value) { |
| 1435 f.call$1(key); | 1415 f(key); |
| 1436 } | 1416 } |
| 1437 ); | 1417 ); |
| 1438 } | 1418 } |
| 1439 HashSetImplementation.prototype.filter = function(f) { | 1419 HashSetImplementation.prototype.filter = function(f) { |
| 1440 var result = new HashSetImplementation(); | 1420 var result = new HashSetImplementation(); |
| 1441 this._backingMap.forEach(function _(key, value) { | 1421 this._backingMap.forEach(function _(key, value) { |
| 1442 if (f.call$1(key)) result.add(key); | 1422 if (f(key)) result.add(key); |
| 1443 } | 1423 } |
| 1444 ); | 1424 ); |
| 1445 return result; | 1425 return result; |
| 1446 } | 1426 } |
| 1447 HashSetImplementation.prototype.every = function(f) { | 1427 HashSetImplementation.prototype.every = function(f) { |
| 1448 var keys = this._backingMap.getKeys(); | 1428 var keys = this._backingMap.getKeys(); |
| 1449 return keys.every(f); | 1429 return keys.every(f); |
| 1450 } | 1430 } |
| 1451 HashSetImplementation.prototype.some = function(f) { | 1431 HashSetImplementation.prototype.some = function(f) { |
| 1452 var keys = this._backingMap.getKeys(); | 1432 var keys = this._backingMap.getKeys(); |
| 1453 return keys.some(f); | 1433 return keys.some(f); |
| 1454 } | 1434 } |
| 1455 HashSetImplementation.prototype.isEmpty = function() { | 1435 HashSetImplementation.prototype.isEmpty = function() { |
| 1456 return this._backingMap.isEmpty(); | 1436 return this._backingMap.isEmpty(); |
| 1457 } | 1437 } |
| 1458 HashSetImplementation.prototype.get$length = function() { | 1438 HashSetImplementation.prototype.get$length = function() { |
| 1459 return this._backingMap.get$length(); | 1439 return this._backingMap.get$length(); |
| 1460 } | 1440 } |
| 1461 HashSetImplementation.prototype.iterator = function() { | 1441 HashSetImplementation.prototype.iterator = function() { |
| 1462 return new HashSetIterator_E(this); | 1442 return new HashSetIterator_E(this); |
| 1463 } | 1443 } |
| 1464 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; | 1444 HashSetImplementation.prototype.add$1 = HashSetImplementation.prototype.add; |
| 1465 HashSetImplementation.prototype.addAll$1 = HashSetImplementation.prototype.addAl
l; | 1445 HashSetImplementation.prototype.addAll$1 = HashSetImplementation.prototype.addAl
l; |
| 1466 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con
tains; | 1446 HashSetImplementation.prototype.contains$1 = HashSetImplementation.prototype.con
tains; |
| 1447 HashSetImplementation.prototype.every$1 = function($0) { |
| 1448 return this.every(to$call$1($0)); |
| 1449 }; |
| 1467 HashSetImplementation.prototype.filter$1 = function($0) { | 1450 HashSetImplementation.prototype.filter$1 = function($0) { |
| 1468 return this.filter(to$call$1($0)); | 1451 return this.filter(to$call$1($0)); |
| 1469 }; | 1452 }; |
| 1470 HashSetImplementation.prototype.forEach$1 = function($0) { | 1453 HashSetImplementation.prototype.forEach$1 = function($0) { |
| 1471 return this.forEach(to$call$1($0)); | 1454 return this.forEach(to$call$1($0)); |
| 1472 }; | 1455 }; |
| 1473 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm
pty; | 1456 HashSetImplementation.prototype.isEmpty$0 = HashSetImplementation.prototype.isEm
pty; |
| 1474 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite
rator; | 1457 HashSetImplementation.prototype.iterator$0 = HashSetImplementation.prototype.ite
rator; |
| 1458 HashSetImplementation.prototype.some$1 = function($0) { |
| 1459 return this.some(to$call$1($0)); |
| 1460 }; |
| 1475 // ********** Code for HashSetImplementation_E ************** | 1461 // ********** Code for HashSetImplementation_E ************** |
| 1476 $inherits(HashSetImplementation_E, HashSetImplementation); | 1462 $inherits(HashSetImplementation_E, HashSetImplementation); |
| 1477 function HashSetImplementation_E() { | 1463 function HashSetImplementation_E() { |
| 1478 this._backingMap = new HashMapImplementation_E$E(); | 1464 this._backingMap = new HashMapImplementation_E$E(); |
| 1479 } | 1465 } |
| 1480 // ********** Code for HashSetImplementation_Library ************** | 1466 // ********** Code for HashSetImplementation_Library ************** |
| 1481 $inherits(HashSetImplementation_Library, HashSetImplementation); | 1467 $inherits(HashSetImplementation_Library, HashSetImplementation); |
| 1482 function HashSetImplementation_Library() {} | 1468 function HashSetImplementation_Library() {} |
| 1483 // ********** Code for HashSetImplementation_Member ************** | |
| 1484 $inherits(HashSetImplementation_Member, HashSetImplementation); | |
| 1485 function HashSetImplementation_Member() {} | |
| 1486 // ********** Code for HashSetImplementation_dart_core_String ************** | 1469 // ********** Code for HashSetImplementation_dart_core_String ************** |
| 1487 $inherits(HashSetImplementation_dart_core_String, HashSetImplementation); | 1470 $inherits(HashSetImplementation_dart_core_String, HashSetImplementation); |
| 1488 function HashSetImplementation_dart_core_String() {} | 1471 function HashSetImplementation_dart_core_String() {} |
| 1489 // ********** Code for HashSetImplementation_Type ************** | 1472 // ********** Code for HashSetImplementation_Type ************** |
| 1490 $inherits(HashSetImplementation_Type, HashSetImplementation); | 1473 $inherits(HashSetImplementation_Type, HashSetImplementation); |
| 1491 function HashSetImplementation_Type() {} | 1474 function HashSetImplementation_Type() {} |
| 1492 // ********** Code for HashSetIterator ************** | 1475 // ********** Code for HashSetIterator ************** |
| 1493 function HashSetIterator(set_) { | 1476 function HashSetIterator(set_) { |
| 1494 this._entries = set_._backingMap._keys; | 1477 this._entries = set_._backingMap._keys; |
| 1495 this._nextValidIndex = (-1); | 1478 this._nextValidIndex = (-1); |
| 1496 this._advance(); | 1479 this._advance(); |
| 1497 } | 1480 } |
| 1498 HashSetIterator.prototype.hasNext = function() { | 1481 HashSetIterator.prototype.hasNext = function() { |
| 1499 if (this._nextValidIndex >= this._entries.get$length()) return false; | 1482 if (this._nextValidIndex >= this._entries.get$length()) return false; |
| 1500 if (this._entries[this._nextValidIndex] == const$0001) { | 1483 if (this._entries.$index(this._nextValidIndex) == const$0001) { |
| 1501 this._advance(); | 1484 this._advance(); |
| 1502 } | 1485 } |
| 1503 return this._nextValidIndex < this._entries.get$length(); | 1486 return this._nextValidIndex < this._entries.get$length(); |
| 1504 } | 1487 } |
| 1505 HashSetIterator.prototype.next = function() { | 1488 HashSetIterator.prototype.next = function() { |
| 1506 if (!this.hasNext()) { | 1489 if (!this.hasNext()) { |
| 1507 $throw(const$0005); | 1490 $throw(const$0005); |
| 1508 } | 1491 } |
| 1509 var res = this._entries[this._nextValidIndex]; | 1492 var res = this._entries.$index(this._nextValidIndex); |
| 1510 this._advance(); | 1493 this._advance(); |
| 1511 return res; | 1494 return res; |
| 1512 } | 1495 } |
| 1513 HashSetIterator.prototype._advance = function() { | 1496 HashSetIterator.prototype._advance = function() { |
| 1514 var length = this._entries.get$length(); | 1497 var length = this._entries.get$length(); |
| 1515 var entry; | 1498 var entry; |
| 1516 var deletedKey = const$0001; | 1499 var deletedKey = const$0001; |
| 1517 do { | 1500 do { |
| 1518 if (++this._nextValidIndex >= length) break; | 1501 if (++this._nextValidIndex >= length) break; |
| 1519 entry = this._entries[this._nextValidIndex]; | 1502 entry = this._entries.$index(this._nextValidIndex); |
| 1520 } | 1503 } |
| 1521 while ((entry == null) || (entry == deletedKey)) | 1504 while ((entry == null) || (entry == deletedKey)) |
| 1522 } | 1505 } |
| 1523 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; | 1506 HashSetIterator.prototype.hasNext$0 = HashSetIterator.prototype.hasNext; |
| 1524 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; | 1507 HashSetIterator.prototype.next$0 = HashSetIterator.prototype.next; |
| 1525 // ********** Code for HashSetIterator_E ************** | 1508 // ********** Code for HashSetIterator_E ************** |
| 1526 $inherits(HashSetIterator_E, HashSetIterator); | 1509 $inherits(HashSetIterator_E, HashSetIterator); |
| 1527 function HashSetIterator_E(set_) { | 1510 function HashSetIterator_E(set_) { |
| 1528 this._nextValidIndex = (-1); | 1511 this._nextValidIndex = (-1); |
| 1529 this._entries = set_._backingMap._keys; | 1512 this._entries = set_._backingMap._keys; |
| 1530 this._advance(); | 1513 this._advance(); |
| 1531 } | 1514 } |
| 1532 HashSetIterator_E.prototype._advance = function() { | 1515 HashSetIterator_E.prototype._advance = function() { |
| 1533 var length = this._entries.get$length(); | 1516 var length = this._entries.get$length(); |
| 1534 var entry; | 1517 var entry; |
| 1535 var deletedKey = const$0001; | 1518 var deletedKey = const$0001; |
| 1536 do { | 1519 do { |
| 1537 if (++this._nextValidIndex >= length) break; | 1520 if (++this._nextValidIndex >= length) break; |
| 1538 entry = this._entries[this._nextValidIndex]; | 1521 entry = this._entries.$index(this._nextValidIndex); |
| 1539 } | 1522 } |
| 1540 while ((entry == null) || (entry == deletedKey)) | 1523 while ((entry == null) || (entry == deletedKey)) |
| 1541 } | 1524 } |
| 1542 // ********** Code for _DeletedKeySentinel ************** | 1525 // ********** Code for _DeletedKeySentinel ************** |
| 1543 function _DeletedKeySentinel() { | 1526 function _DeletedKeySentinel() { |
| 1544 | 1527 |
| 1545 } | 1528 } |
| 1546 // ********** Code for KeyValuePair ************** | 1529 // ********** Code for KeyValuePair ************** |
| 1547 function KeyValuePair(key, value) { | 1530 function KeyValuePair(key, value) { |
| 1548 this.value = value; | 1531 this.value = value; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 1571 } | 1554 } |
| 1572 } | 1555 } |
| 1573 LinkedHashMapImplementation.prototype.$index = function(key) { | 1556 LinkedHashMapImplementation.prototype.$index = function(key) { |
| 1574 var entry = this._map.$index(key); | 1557 var entry = this._map.$index(key); |
| 1575 if (entry == null) return null; | 1558 if (entry == null) return null; |
| 1576 return entry.get$element().get$value(); | 1559 return entry.get$element().get$value(); |
| 1577 } | 1560 } |
| 1578 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { | 1561 LinkedHashMapImplementation.prototype.putIfAbsent = function(key, ifAbsent) { |
| 1579 var value = this.$index(key); | 1562 var value = this.$index(key); |
| 1580 if ((this.$index(key) == null) && !(this.containsKey(key))) { | 1563 if ((this.$index(key) == null) && !(this.containsKey(key))) { |
| 1581 value = ifAbsent.call$0(); | 1564 value = ifAbsent(); |
| 1582 this.$setindex(key, value); | 1565 this.$setindex(key, value); |
| 1583 } | 1566 } |
| 1584 return value; | 1567 return value; |
| 1585 } | 1568 } |
| 1586 LinkedHashMapImplementation.prototype.getKeys = function() { | 1569 LinkedHashMapImplementation.prototype.getKeys = function() { |
| 1587 var list = new Array(this.get$length()); | 1570 var list = new Array(this.get$length()); |
| 1588 var index = (0); | 1571 var index = (0); |
| 1589 this._list.forEach(function _(entry) { | 1572 this._list.forEach(function _(entry) { |
| 1590 list.$setindex(index++, entry.key); | 1573 list.$setindex(index++, entry.key); |
| 1591 } | 1574 } |
| 1592 ); | 1575 ); |
| 1593 return list; | 1576 return list; |
| 1594 } | 1577 } |
| 1595 LinkedHashMapImplementation.prototype.getValues = function() { | 1578 LinkedHashMapImplementation.prototype.getValues = function() { |
| 1596 var list = new Array(this.get$length()); | 1579 var list = new Array(this.get$length()); |
| 1597 var index = (0); | 1580 var index = (0); |
| 1598 this._list.forEach(function _(entry) { | 1581 this._list.forEach(function _(entry) { |
| 1599 list.$setindex(index++, entry.value); | 1582 list.$setindex(index++, entry.value); |
| 1600 } | 1583 } |
| 1601 ); | 1584 ); |
| 1602 return list; | 1585 return list; |
| 1603 } | 1586 } |
| 1604 LinkedHashMapImplementation.prototype.forEach = function(f) { | 1587 LinkedHashMapImplementation.prototype.forEach = function(f) { |
| 1605 this._list.forEach(function _(entry) { | 1588 this._list.forEach(function _(entry) { |
| 1606 f.call$2(entry.key, entry.value); | 1589 f(entry.key, entry.value); |
| 1607 } | 1590 } |
| 1608 ); | 1591 ); |
| 1609 } | 1592 } |
| 1610 LinkedHashMapImplementation.prototype.containsKey = function(key) { | 1593 LinkedHashMapImplementation.prototype.containsKey = function(key) { |
| 1611 return this._map.containsKey(key); | 1594 return this._map.containsKey(key); |
| 1612 } | 1595 } |
| 1613 LinkedHashMapImplementation.prototype.get$length = function() { | 1596 LinkedHashMapImplementation.prototype.get$length = function() { |
| 1614 return this._map.get$length(); | 1597 return this._map.get$length(); |
| 1615 } | 1598 } |
| 1616 LinkedHashMapImplementation.prototype.isEmpty = function() { | 1599 LinkedHashMapImplementation.prototype.isEmpty = function() { |
| 1617 return this.get$length() == (0); | 1600 return this.get$length() == (0); |
| 1618 } | 1601 } |
| 1619 LinkedHashMapImplementation.prototype.containsKey$1 = LinkedHashMapImplementatio
n.prototype.containsKey; | 1602 LinkedHashMapImplementation.prototype.containsKey$1 = LinkedHashMapImplementatio
n.prototype.containsKey; |
| 1620 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { | 1603 LinkedHashMapImplementation.prototype.forEach$1 = function($0) { |
| 1621 return this.forEach(to$call$2($0)); | 1604 return this.forEach(to$call$2($0)); |
| 1622 }; | 1605 }; |
| 1623 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr
ototype.getKeys; | 1606 LinkedHashMapImplementation.prototype.getKeys$0 = LinkedHashMapImplementation.pr
ototype.getKeys; |
| 1624 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation.
prototype.getValues; | 1607 LinkedHashMapImplementation.prototype.getValues$0 = LinkedHashMapImplementation.
prototype.getValues; |
| 1625 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr
ototype.isEmpty; | 1608 LinkedHashMapImplementation.prototype.isEmpty$0 = LinkedHashMapImplementation.pr
ototype.isEmpty; |
| 1609 LinkedHashMapImplementation.prototype.putIfAbsent$2 = function($0, $1) { |
| 1610 return this.putIfAbsent($0, to$call$0($1)); |
| 1611 }; |
| 1626 // ********** Code for DoubleLinkedQueueEntry ************** | 1612 // ********** Code for DoubleLinkedQueueEntry ************** |
| 1627 function DoubleLinkedQueueEntry(e) { | 1613 function DoubleLinkedQueueEntry(e) { |
| 1628 this._element = e; | 1614 this._element = e; |
| 1629 } | 1615 } |
| 1630 DoubleLinkedQueueEntry.prototype._link = function(p, n) { | 1616 DoubleLinkedQueueEntry.prototype._link = function(p, n) { |
| 1631 this._next = n; | 1617 this._next = n; |
| 1632 this._previous = p; | 1618 this._previous = p; |
| 1633 p._next = this; | 1619 p._next = this; |
| 1634 n._previous = this; | 1620 n._previous = this; |
| 1635 } | 1621 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 ); | 1758 ); |
| 1773 return counter; | 1759 return counter; |
| 1774 } | 1760 } |
| 1775 DoubleLinkedQueue.prototype.isEmpty = function() { | 1761 DoubleLinkedQueue.prototype.isEmpty = function() { |
| 1776 return (this._sentinel._next == this._sentinel); | 1762 return (this._sentinel._next == this._sentinel); |
| 1777 } | 1763 } |
| 1778 DoubleLinkedQueue.prototype.forEach = function(f) { | 1764 DoubleLinkedQueue.prototype.forEach = function(f) { |
| 1779 var entry = this._sentinel._next; | 1765 var entry = this._sentinel._next; |
| 1780 while (entry != this._sentinel) { | 1766 while (entry != this._sentinel) { |
| 1781 var nextEntry = entry._next; | 1767 var nextEntry = entry._next; |
| 1782 f.call$1(entry._element); | 1768 f(entry._element); |
| 1783 entry = nextEntry; | 1769 entry = nextEntry; |
| 1784 } | 1770 } |
| 1785 } | 1771 } |
| 1786 DoubleLinkedQueue.prototype.every = function(f) { | 1772 DoubleLinkedQueue.prototype.every = function(f) { |
| 1787 var entry = this._sentinel._next; | 1773 var entry = this._sentinel._next; |
| 1788 while (entry != this._sentinel) { | 1774 while (entry != this._sentinel) { |
| 1789 var nextEntry = entry._next; | 1775 var nextEntry = entry._next; |
| 1790 if (!f.call$1(entry._element)) return false; | 1776 if (!f(entry._element)) return false; |
| 1791 entry = nextEntry; | 1777 entry = nextEntry; |
| 1792 } | 1778 } |
| 1793 return true; | 1779 return true; |
| 1794 } | 1780 } |
| 1795 DoubleLinkedQueue.prototype.some = function(f) { | 1781 DoubleLinkedQueue.prototype.some = function(f) { |
| 1796 var entry = this._sentinel._next; | 1782 var entry = this._sentinel._next; |
| 1797 while (entry != this._sentinel) { | 1783 while (entry != this._sentinel) { |
| 1798 var nextEntry = entry._next; | 1784 var nextEntry = entry._next; |
| 1799 if (f.call$1(entry._element)) return true; | 1785 if (f(entry._element)) return true; |
| 1800 entry = nextEntry; | 1786 entry = nextEntry; |
| 1801 } | 1787 } |
| 1802 return false; | 1788 return false; |
| 1803 } | 1789 } |
| 1804 DoubleLinkedQueue.prototype.filter = function(f) { | 1790 DoubleLinkedQueue.prototype.filter = function(f) { |
| 1805 var other = new DoubleLinkedQueue(); | 1791 var other = new DoubleLinkedQueue(); |
| 1806 var entry = this._sentinel._next; | 1792 var entry = this._sentinel._next; |
| 1807 while (entry != this._sentinel) { | 1793 while (entry != this._sentinel) { |
| 1808 var nextEntry = entry._next; | 1794 var nextEntry = entry._next; |
| 1809 if (f.call$1(entry._element)) other.addLast(entry._element); | 1795 if (f(entry._element)) other.addLast(entry._element); |
| 1810 entry = nextEntry; | 1796 entry = nextEntry; |
| 1811 } | 1797 } |
| 1812 return other; | 1798 return other; |
| 1813 } | 1799 } |
| 1814 DoubleLinkedQueue.prototype.iterator = function() { | 1800 DoubleLinkedQueue.prototype.iterator = function() { |
| 1815 return new _DoubleLinkedQueueIterator_E(this._sentinel); | 1801 return new _DoubleLinkedQueueIterator_E(this._sentinel); |
| 1816 } | 1802 } |
| 1817 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; | 1803 DoubleLinkedQueue.prototype.add$1 = DoubleLinkedQueue.prototype.add; |
| 1818 DoubleLinkedQueue.prototype.addAll$1 = DoubleLinkedQueue.prototype.addAll; | 1804 DoubleLinkedQueue.prototype.addAll$1 = DoubleLinkedQueue.prototype.addAll; |
| 1819 DoubleLinkedQueue.prototype.addLast$1 = DoubleLinkedQueue.prototype.addLast; | 1805 DoubleLinkedQueue.prototype.addLast$1 = DoubleLinkedQueue.prototype.addLast; |
| 1806 DoubleLinkedQueue.prototype.every$1 = function($0) { |
| 1807 return this.every(to$call$1($0)); |
| 1808 }; |
| 1820 DoubleLinkedQueue.prototype.filter$1 = function($0) { | 1809 DoubleLinkedQueue.prototype.filter$1 = function($0) { |
| 1821 return this.filter(to$call$1($0)); | 1810 return this.filter(to$call$1($0)); |
| 1822 }; | 1811 }; |
| 1823 DoubleLinkedQueue.prototype.forEach$1 = function($0) { | 1812 DoubleLinkedQueue.prototype.forEach$1 = function($0) { |
| 1824 return this.forEach(to$call$1($0)); | 1813 return this.forEach(to$call$1($0)); |
| 1825 }; | 1814 }; |
| 1826 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; | 1815 DoubleLinkedQueue.prototype.isEmpty$0 = DoubleLinkedQueue.prototype.isEmpty; |
| 1827 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; | 1816 DoubleLinkedQueue.prototype.iterator$0 = DoubleLinkedQueue.prototype.iterator; |
| 1828 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; | 1817 DoubleLinkedQueue.prototype.last$0 = DoubleLinkedQueue.prototype.last; |
| 1818 DoubleLinkedQueue.prototype.removeFirst$0 = DoubleLinkedQueue.prototype.removeFi
rst; |
| 1829 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas
t; | 1819 DoubleLinkedQueue.prototype.removeLast$0 = DoubleLinkedQueue.prototype.removeLas
t; |
| 1820 DoubleLinkedQueue.prototype.some$1 = function($0) { |
| 1821 return this.some(to$call$1($0)); |
| 1822 }; |
| 1830 // ********** Code for DoubleLinkedQueue_E ************** | 1823 // ********** Code for DoubleLinkedQueue_E ************** |
| 1831 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); | 1824 $inherits(DoubleLinkedQueue_E, DoubleLinkedQueue); |
| 1832 function DoubleLinkedQueue_E() {} | 1825 function DoubleLinkedQueue_E() {} |
| 1833 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** | 1826 // ********** Code for DoubleLinkedQueue_KeyValuePair_K$V ************** |
| 1834 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); | 1827 $inherits(DoubleLinkedQueue_KeyValuePair_K$V, DoubleLinkedQueue); |
| 1835 function DoubleLinkedQueue_KeyValuePair_K$V() { | 1828 function DoubleLinkedQueue_KeyValuePair_K$V() { |
| 1836 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V(); | 1829 this._sentinel = new _DoubleLinkedQueueEntrySentinel_KeyValuePair_K$V(); |
| 1837 } | 1830 } |
| 1838 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) { | 1831 DoubleLinkedQueue_KeyValuePair_K$V.prototype.addLast = function(value) { |
| 1839 this._sentinel.prepend(value); | 1832 this._sentinel.prepend(value); |
| 1840 } | 1833 } |
| 1841 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() { | 1834 DoubleLinkedQueue_KeyValuePair_K$V.prototype.lastEntry = function() { |
| 1842 return this._sentinel.previousEntry(); | 1835 return this._sentinel.previousEntry(); |
| 1843 } | 1836 } |
| 1844 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) { | 1837 DoubleLinkedQueue_KeyValuePair_K$V.prototype.forEach = function(f) { |
| 1845 var entry = this._sentinel._next; | 1838 var entry = this._sentinel._next; |
| 1846 while (entry != this._sentinel) { | 1839 while (entry != this._sentinel) { |
| 1847 var nextEntry = entry._next; | 1840 var nextEntry = entry._next; |
| 1848 f.call$1(entry._element); | 1841 f(entry._element); |
| 1849 entry = nextEntry; | 1842 entry = nextEntry; |
| 1850 } | 1843 } |
| 1851 } | 1844 } |
| 1852 // ********** Code for _DoubleLinkedQueueIterator ************** | 1845 // ********** Code for _DoubleLinkedQueueIterator ************** |
| 1853 function _DoubleLinkedQueueIterator(_sentinel) { | 1846 function _DoubleLinkedQueueIterator(_sentinel) { |
| 1854 this._sentinel = _sentinel; | 1847 this._sentinel = _sentinel; |
| 1855 this._currentEntry = this._sentinel; | 1848 this._currentEntry = this._sentinel; |
| 1856 } | 1849 } |
| 1857 _DoubleLinkedQueueIterator.prototype.hasNext = function() { | 1850 _DoubleLinkedQueueIterator.prototype.hasNext = function() { |
| 1858 return this._currentEntry._next != this._sentinel; | 1851 return this._currentEntry._next != this._sentinel; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1920 StringBufferImpl.prototype.get$length = function() { | 1913 StringBufferImpl.prototype.get$length = function() { |
| 1921 return this._length; | 1914 return this._length; |
| 1922 } | 1915 } |
| 1923 StringBufferImpl.prototype.isEmpty = function() { | 1916 StringBufferImpl.prototype.isEmpty = function() { |
| 1924 return this._length == (0); | 1917 return this._length == (0); |
| 1925 } | 1918 } |
| 1926 StringBufferImpl.prototype.add = function(obj) { | 1919 StringBufferImpl.prototype.add = function(obj) { |
| 1927 var str = obj.toString$0(); | 1920 var str = obj.toString$0(); |
| 1928 if (str == null || str.isEmpty()) return this; | 1921 if (str == null || str.isEmpty()) return this; |
| 1929 this._buffer.add(str); | 1922 this._buffer.add(str); |
| 1930 this._length = $add(this._length, str.length); | 1923 this._length += str.length; |
| 1931 return this; | 1924 return this; |
| 1932 } | 1925 } |
| 1933 StringBufferImpl.prototype.addAll = function(objects) { | 1926 StringBufferImpl.prototype.addAll = function(objects) { |
| 1934 for (var $$i = objects.iterator$0(); $$i.hasNext$0(); ) { | 1927 for (var $$i = objects.iterator$0(); $$i.hasNext$0(); ) { |
| 1935 var obj = $$i.next$0(); | 1928 var obj = $$i.next$0(); |
| 1936 this.add(obj); | 1929 this.add(obj); |
| 1937 } | 1930 } |
| 1938 return this; | 1931 return this; |
| 1939 } | 1932 } |
| 1940 StringBufferImpl.prototype.clear = function() { | 1933 StringBufferImpl.prototype.clear = function() { |
| 1941 this._buffer = new Array(); | 1934 this._buffer = new Array(); |
| 1942 this._length = (0); | 1935 this._length = (0); |
| 1943 return this; | 1936 return this; |
| 1944 } | 1937 } |
| 1945 StringBufferImpl.prototype.toString = function() { | 1938 StringBufferImpl.prototype.toString = function() { |
| 1946 if (this._buffer.get$length() == (0)) return ""; | 1939 if (this._buffer.get$length() == (0)) return ""; |
| 1947 if (this._buffer.get$length() == (1)) return this._buffer[(0)]; | 1940 if (this._buffer.get$length() == (1)) return this._buffer.$index((0)); |
| 1948 var result = StringBase.concatAll(this._buffer); | 1941 var result = StringBase.concatAll(this._buffer); |
| 1949 this._buffer.clear(); | 1942 this._buffer.clear(); |
| 1950 this._buffer.add(result); | 1943 this._buffer.add(result); |
| 1951 return result; | 1944 return result; |
| 1952 } | 1945 } |
| 1953 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; | 1946 StringBufferImpl.prototype.add$1 = StringBufferImpl.prototype.add; |
| 1954 StringBufferImpl.prototype.addAll$1 = StringBufferImpl.prototype.addAll; | 1947 StringBufferImpl.prototype.addAll$1 = StringBufferImpl.prototype.addAll; |
| 1955 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; | 1948 StringBufferImpl.prototype.isEmpty$0 = StringBufferImpl.prototype.isEmpty; |
| 1956 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; | 1949 StringBufferImpl.prototype.toString$0 = StringBufferImpl.prototype.toString; |
| 1957 // ********** Code for StringBase ************** | 1950 // ********** Code for StringBase ************** |
| 1958 function StringBase() {} | 1951 function StringBase() {} |
| 1959 StringBase.createFromCharCodes = function(charCodes) { | 1952 StringBase.createFromCharCodes = function(charCodes) { |
| 1960 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { | 1953 if (Object.getPrototypeOf(charCodes) !== Array.prototype) { |
| 1961 charCodes = new ListFactory.ListFactory$from$factory(charCodes); | 1954 charCodes = new ListFactory.ListFactory$from$factory(charCodes); |
| 1962 } | 1955 } |
| 1963 return String.fromCharCode.apply(null, charCodes); | 1956 return String.fromCharCode.apply(null, charCodes); |
| 1964 } | 1957 } |
| 1965 StringBase.join = function(strings, separator) { | 1958 StringBase.join = function(strings, separator) { |
| 1966 if (strings.get$length() == (0)) return ""; | 1959 if (strings.get$length() == (0)) return ""; |
| 1967 var s = strings[(0)]; | 1960 var s = strings.$index((0)); |
| 1968 for (var i = (1); | 1961 for (var i = (1); |
| 1969 i < strings.get$length(); i++) { | 1962 i < strings.get$length(); i++) { |
| 1970 s = s + separator + strings[i]; | 1963 s = s + separator + strings.$index(i); |
| 1971 } | 1964 } |
| 1972 return s; | 1965 return s; |
| 1973 } | 1966 } |
| 1974 StringBase.concatAll = function(strings) { | 1967 StringBase.concatAll = function(strings) { |
| 1975 return StringBase.join(strings, ""); | 1968 return StringBase.join(strings, ""); |
| 1976 } | 1969 } |
| 1977 // ********** Code for StringImplementation ************** | 1970 // ********** Code for StringImplementation ************** |
| 1978 StringImplementation = String; | 1971 StringImplementation = String; |
| 1979 StringImplementation.prototype.get$length = function() { return this.length; }; | 1972 StringImplementation.prototype.get$length = function() { return this.length; }; |
| 1980 StringImplementation.prototype.endsWith = function(other) { | 1973 StringImplementation.prototype.endsWith = function(other) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2052 StringImplementation.prototype.isEmpty$0 = StringImplementation.prototype.isEmpt
y; | 2045 StringImplementation.prototype.isEmpty$0 = StringImplementation.prototype.isEmpt
y; |
| 2053 StringImplementation.prototype.replaceFirst$2 = StringImplementation.prototype.r
eplaceFirst; | 2046 StringImplementation.prototype.replaceFirst$2 = StringImplementation.prototype.r
eplaceFirst; |
| 2054 StringImplementation.prototype.startsWith$1 = StringImplementation.prototype.sta
rtsWith; | 2047 StringImplementation.prototype.startsWith$1 = StringImplementation.prototype.sta
rtsWith; |
| 2055 StringImplementation.prototype.substring$1 = StringImplementation.prototype.subs
tring; | 2048 StringImplementation.prototype.substring$1 = StringImplementation.prototype.subs
tring; |
| 2056 StringImplementation.prototype.substring$2 = StringImplementation.prototype.subs
tring; | 2049 StringImplementation.prototype.substring$2 = StringImplementation.prototype.subs
tring; |
| 2057 // ********** Code for Collections ************** | 2050 // ********** Code for Collections ************** |
| 2058 function Collections() {} | 2051 function Collections() {} |
| 2059 Collections.forEach = function(iterable, f) { | 2052 Collections.forEach = function(iterable, f) { |
| 2060 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2053 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2061 var e = $$i.next$0(); | 2054 var e = $$i.next$0(); |
| 2062 f.call$1(e); | 2055 f(e); |
| 2063 } | 2056 } |
| 2064 } | 2057 } |
| 2065 Collections.some = function(iterable, f) { | 2058 Collections.some = function(iterable, f) { |
| 2066 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2059 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2067 var e = $$i.next$0(); | 2060 var e = $$i.next$0(); |
| 2068 if (f.call$1(e)) return true; | 2061 if (f(e)) return true; |
| 2069 } | 2062 } |
| 2070 return false; | 2063 return false; |
| 2071 } | 2064 } |
| 2072 Collections.every = function(iterable, f) { | 2065 Collections.every = function(iterable, f) { |
| 2073 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { | 2066 for (var $$i = iterable.iterator$0(); $$i.hasNext$0(); ) { |
| 2074 var e = $$i.next$0(); | 2067 var e = $$i.next$0(); |
| 2075 if (!f.call$1(e)) return false; | 2068 if (!f(e)) return false; |
| 2076 } | 2069 } |
| 2077 return true; | 2070 return true; |
| 2078 } | 2071 } |
| 2079 Collections.filter = function(source, destination, f) { | 2072 Collections.filter = function(source, destination, f) { |
| 2080 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { | 2073 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { |
| 2081 var e = $$i.next$0(); | 2074 var e = $$i.next$0(); |
| 2082 if (f.call$1(e)) destination.add(e); | 2075 if (f(e)) destination.add(e); |
| 2083 } | 2076 } |
| 2084 return destination; | 2077 return destination; |
| 2085 } | 2078 } |
| 2086 // ********** Code for _Worker ************** | 2079 // ********** Code for _Worker ************** |
| 2087 // ********** Code for _ArgumentMismatchException ************** | 2080 // ********** Code for _ArgumentMismatchException ************** |
| 2088 $inherits(_ArgumentMismatchException, ClosureArgumentMismatchException); | 2081 $inherits(_ArgumentMismatchException, ClosureArgumentMismatchException); |
| 2089 function _ArgumentMismatchException(_message) { | 2082 function _ArgumentMismatchException(_message) { |
| 2090 this._dart_coreimpl_message = _message; | 2083 this._dart_coreimpl_message = _message; |
| 2091 ClosureArgumentMismatchException.call(this); | 2084 ClosureArgumentMismatchException.call(this); |
| 2092 } | 2085 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2158 // TODO(jmesserly): evaluate the performance of these stubs. | 2151 // TODO(jmesserly): evaluate the performance of these stubs. |
| 2159 var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}'; | 2152 var f = 'function(' + a.join(',') + '){return $f(' + p.join(',') + ');}'; |
| 2160 return new Function('$f', 'return ' + f + '').call(null, this); | 2153 return new Function('$f', 'return ' + f + '').call(null, this); |
| 2161 | 2154 |
| 2162 } | 2155 } |
| 2163 // ********** Code for top level ************** | 2156 // ********** Code for top level ************** |
| 2164 function _map(itemsAndKeys) { | 2157 function _map(itemsAndKeys) { |
| 2165 var ret = new LinkedHashMapImplementation(); | 2158 var ret = new LinkedHashMapImplementation(); |
| 2166 for (var i = (0); | 2159 for (var i = (0); |
| 2167 i < itemsAndKeys.get$length(); ) { | 2160 i < itemsAndKeys.get$length(); ) { |
| 2168 ret.$setindex(itemsAndKeys[i++], itemsAndKeys[i++]); | 2161 ret.$setindex(itemsAndKeys.$index(i++), itemsAndKeys.$index(i++)); |
| 2169 } | 2162 } |
| 2170 return ret; | 2163 return ret; |
| 2171 } | 2164 } |
| 2172 // ********** Library node ************** | 2165 // ********** Library node ************** |
| 2173 // ********** Code for Process ************** | 2166 // ********** Code for Process ************** |
| 2174 function Process(_process) { | 2167 function Process(_process) { |
| 2175 this.SIGSYS = "SIGSYS"; | 2168 this.SIGSYS = "SIGSYS"; |
| 2176 this.SIGALRM = "SIGALRM"; | 2169 this.SIGALRM = "SIGALRM"; |
| 2177 this.SIGXCPU = "SIGXCPU"; | 2170 this.SIGXCPU = "SIGXCPU"; |
| 2178 this.SIGTSTP = "SIGTSTP"; | 2171 this.SIGTSTP = "SIGTSTP"; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2319 } | 2312 } |
| 2320 function get$process() { | 2313 function get$process() { |
| 2321 return new Process(get$_process()); | 2314 return new Process(get$_process()); |
| 2322 } | 2315 } |
| 2323 // ********** Library file_system ************** | 2316 // ********** Library file_system ************** |
| 2324 // ********** Code for top level ************** | 2317 // ********** Code for top level ************** |
| 2325 function joinPaths(path1, path2) { | 2318 function joinPaths(path1, path2) { |
| 2326 var pieces = path1.split("/"); | 2319 var pieces = path1.split("/"); |
| 2327 var $$list = path2.split("/"); | 2320 var $$list = path2.split("/"); |
| 2328 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2321 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2329 var piece = $$list[$$i]; | 2322 var piece = $$list.$index($$i); |
| 2330 if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last$0(), ".
") && $ne(pieces.last$0(), "..")) { | 2323 if ($eq(piece, "..") && pieces.get$length() > (0) && $ne(pieces.last$0(), ".
") && $ne(pieces.last$0(), "..")) { |
| 2331 pieces.removeLast$0(); | 2324 pieces.removeLast$0(); |
| 2332 } | 2325 } |
| 2333 else if ($ne(piece, "")) { | 2326 else if ($ne(piece, "")) { |
| 2334 if (pieces.get$length() > (0) && $eq(pieces.last$0(), ".")) { | 2327 if (pieces.get$length() > (0) && $eq(pieces.last$0(), ".")) { |
| 2335 pieces.removeLast$0(); | 2328 pieces.removeLast$0(); |
| 2336 } | 2329 } |
| 2337 pieces.add$1(piece); | 2330 pieces.add$1(piece); |
| 2338 } | 2331 } |
| 2339 } | 2332 } |
| 2340 return Strings.join(pieces, "/"); | 2333 return Strings.join(pieces, "/"); |
| 2341 } | 2334 } |
| 2342 function dirname(path) { | 2335 function dirname(path) { |
| 2343 var lastSlash = path.lastIndexOf("/", path.length); | 2336 var lastSlash = path.lastIndexOf("/", path.length); |
| 2344 if (lastSlash == (-1)) { | 2337 if (lastSlash == (-1)) { |
| 2345 return "."; | 2338 return "."; |
| 2346 } | 2339 } |
| 2347 else { | 2340 else { |
| 2348 return path.substring((0), lastSlash); | 2341 return path.substring((0), lastSlash); |
| 2349 } | 2342 } |
| 2350 } | 2343 } |
| 2351 function basename(path) { | 2344 function basename(path) { |
| 2352 var lastSlash = path.lastIndexOf("/", path.length); | 2345 var lastSlash = path.lastIndexOf("/", path.length); |
| 2353 if (lastSlash == (-1)) { | 2346 if (lastSlash == (-1)) { |
| 2354 return path; | 2347 return path; |
| 2355 } | 2348 } |
| 2356 else { | 2349 else { |
| 2357 return path.substring($add(lastSlash, (1))); | 2350 return path.substring(lastSlash + (1)); |
| 2358 } | 2351 } |
| 2359 } | 2352 } |
| 2360 // ********** Library file_system_node ************** | 2353 // ********** Library file_system_node ************** |
| 2361 // ********** Code for NodeFileSystem ************** | 2354 // ********** Code for NodeFileSystem ************** |
| 2362 function NodeFileSystem() { | 2355 function NodeFileSystem() { |
| 2363 | 2356 |
| 2364 } | 2357 } |
| 2365 NodeFileSystem.prototype.writeString = function(outfile, text) { | 2358 NodeFileSystem.prototype.writeString = function(outfile, text) { |
| 2366 fs.writeFileSync(outfile, text); | 2359 fs.writeFileSync(outfile, text); |
| 2367 } | 2360 } |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2693 else { | 2686 else { |
| 2694 if (this.useWrap0) { | 2687 if (this.useWrap0) { |
| 2695 w.writeln("function $wrap_call$0(fn) { return fn; }"); | 2688 w.writeln("function $wrap_call$0(fn) { return fn; }"); |
| 2696 } | 2689 } |
| 2697 if (this.useWrap1) { | 2690 if (this.useWrap1) { |
| 2698 w.writeln("function $wrap_call$1(fn) { return fn; }"); | 2691 w.writeln("function $wrap_call$1(fn) { return fn; }"); |
| 2699 } | 2692 } |
| 2700 } | 2693 } |
| 2701 var $$list = orderValuesByKeys(this._usedOperators); | 2694 var $$list = orderValuesByKeys(this._usedOperators); |
| 2702 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2695 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2703 var opImpl = $$list[$$i]; | 2696 var opImpl = $$list.$index($$i); |
| 2704 w.writeln(opImpl); | 2697 w.writeln(opImpl); |
| 2705 } | 2698 } |
| 2706 if ($globals.world.dom != null) { | 2699 if ($globals.world.dom != null) { |
| 2707 this.ensureTypeNameOf(); | 2700 this.ensureTypeNameOf(); |
| 2708 w.writeln("Object.defineProperty(Object.prototype, \"get$typeName\", { value
: Object.prototype.$typeNameOf, enumerable: false, writable: true, configurable:
true});"); | 2701 w.writeln("Object.defineProperty(Object.prototype, \"get$typeName\", { value
: Object.prototype.$typeNameOf, enumerable: false, writable: true, configurable:
true});"); |
| 2709 } | 2702 } |
| 2710 } | 2703 } |
| 2711 CoreJs.prototype.generate$1 = CoreJs.prototype.generate; | 2704 CoreJs.prototype.generate$1 = CoreJs.prototype.generate; |
| 2712 // ********** Code for Element ************** | 2705 // ********** Code for Element ************** |
| 2713 function Element(name, _enclosingElement) { | 2706 function Element(name, _enclosingElement) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2746 Element.prototype.resolve = function() { | 2739 Element.prototype.resolve = function() { |
| 2747 | 2740 |
| 2748 } | 2741 } |
| 2749 Element.prototype.get$typeParameters = function() { | 2742 Element.prototype.get$typeParameters = function() { |
| 2750 return null; | 2743 return null; |
| 2751 } | 2744 } |
| 2752 Element.prototype.get$enclosingElement = function() { | 2745 Element.prototype.get$enclosingElement = function() { |
| 2753 return this._enclosingElement == null ? this.get$library() : this._enclosingEl
ement; | 2746 return this._enclosingElement == null ? this.get$library() : this._enclosingEl
ement; |
| 2754 } | 2747 } |
| 2755 Element.prototype.set$enclosingElement = function(e) { | 2748 Element.prototype.set$enclosingElement = function(e) { |
| 2756 var $0; | 2749 return this._enclosingElement = e; |
| 2757 return (this._enclosingElement = ($0 = e), $0); | |
| 2758 } | 2750 } |
| 2759 Element.prototype.resolveType = function(node, typeErrors) { | 2751 Element.prototype.resolveType = function(node, typeErrors) { |
| 2760 if (node == null) return $globals.world.varType; | 2752 if (node == null) return $globals.world.varType; |
| 2761 if (node.type != null) return node.type; | 2753 if (node.type != null) return node.type; |
| 2762 if ((node instanceof NameTypeReference)) { | 2754 if ((node instanceof NameTypeReference)) { |
| 2763 var typeRef = node; | 2755 var typeRef = node; |
| 2764 var name; | 2756 var name; |
| 2765 if (typeRef.names != null) { | 2757 if (typeRef.names != null) { |
| 2766 name = typeRef.names.last().get$name(); | 2758 name = typeRef.names.last$0().get$name(); |
| 2767 } | 2759 } |
| 2768 else { | 2760 else { |
| 2769 name = typeRef.name.name; | 2761 name = typeRef.name.name; |
| 2770 } | 2762 } |
| 2771 if (this.get$typeParameters() != null) { | 2763 if (this.get$typeParameters() != null) { |
| 2772 var $$list = this.get$typeParameters(); | 2764 var $$list = this.get$typeParameters(); |
| 2773 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2765 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2774 var tp = $$list[$$i]; | 2766 var tp = $$list.$index($$i); |
| 2775 if ($eq(tp.get$name(), name)) { | 2767 if ($eq(tp.get$name(), name)) { |
| 2776 typeRef.type = tp; | 2768 typeRef.type = tp; |
| 2777 } | 2769 } |
| 2778 } | 2770 } |
| 2779 } | 2771 } |
| 2780 if (typeRef.type != null) { | 2772 if (typeRef.type != null) { |
| 2781 return typeRef.type; | 2773 return typeRef.type; |
| 2782 } | 2774 } |
| 2783 return this.get$enclosingElement().resolveType$2(node, typeErrors); | 2775 return this.get$enclosingElement().resolveType$2(node, typeErrors); |
| 2784 } | 2776 } |
| 2785 else if ((node instanceof GenericTypeReference)) { | 2777 else if ((node instanceof GenericTypeReference)) { |
| 2786 var typeRef = node; | 2778 var typeRef = node; |
| 2787 var baseType = this.resolveType$2(typeRef.baseType, typeErrors); | 2779 var baseType = this.resolveType$2(typeRef.baseType, typeErrors); |
| 2788 if (!baseType.get$isGeneric()) { | 2780 if (!baseType.get$isGeneric()) { |
| 2789 $globals.world.error(("" + baseType.get$name() + " is not generic"), typeR
ef.span); | 2781 $globals.world.error(("" + baseType.get$name() + " is not generic"), typeR
ef.span); |
| 2790 return null; | 2782 return null; |
| 2791 } | 2783 } |
| 2792 if (typeRef.typeArguments.get$length() != baseType.get$typeParameters().get$
length()) { | 2784 if (typeRef.typeArguments.get$length() != baseType.get$typeParameters().get$
length()) { |
| 2793 $globals.world.error("wrong number of type arguments", typeRef.span); | 2785 $globals.world.error("wrong number of type arguments", typeRef.span); |
| 2794 return null; | 2786 return null; |
| 2795 } | 2787 } |
| 2796 var typeArgs = []; | 2788 var typeArgs = []; |
| 2797 for (var i = (0); | 2789 for (var i = (0); |
| 2798 i < typeRef.typeArguments.get$length(); i++) { | 2790 i < typeRef.typeArguments.get$length(); i++) { |
| 2799 typeArgs.add$1(this.resolveType$2(typeRef.typeArguments[i], typeErrors)); | 2791 typeArgs.add$1(this.resolveType$2(typeRef.typeArguments.$index(i), typeErr
ors)); |
| 2800 } | 2792 } |
| 2801 typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs); | 2793 typeRef.type = baseType.getOrMakeConcreteType$1(typeArgs); |
| 2802 } | 2794 } |
| 2803 else if ((node instanceof FunctionTypeReference)) { | 2795 else if ((node instanceof FunctionTypeReference)) { |
| 2804 var typeRef = node; | 2796 var typeRef = node; |
| 2805 var name = ""; | 2797 var name = ""; |
| 2806 if (typeRef.func.name != null) { | 2798 if (typeRef.func.name != null) { |
| 2807 name = typeRef.func.name.name; | 2799 name = typeRef.func.name.name; |
| 2808 } | 2800 } |
| 2809 typeRef.type = this.get$library().getOrAddFunctionType(this, name, typeRef.f
unc); | 2801 typeRef.type = this.get$library().getOrAddFunctionType(this, name, typeRef.f
unc); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2833 this.markLibrariesUsed([$globals.world.coreimpl, $globals.world.corelib, thi
s.main.declaringType.get$library()]); | 2825 this.markLibrariesUsed([$globals.world.coreimpl, $globals.world.corelib, thi
s.main.declaringType.get$library()]); |
| 2834 } | 2826 } |
| 2835 $globals.world.numImplType.markUsed(); | 2827 $globals.world.numImplType.markUsed(); |
| 2836 $globals.world.stringImplType.markUsed(); | 2828 $globals.world.stringImplType.markUsed(); |
| 2837 if ($globals.world.corelib.types.$index("Isolate").get$isUsed() || $globals.wo
rld.coreimpl.types.$index("ReceivePortImpl").get$isUsed()) { | 2829 if ($globals.world.corelib.types.$index("Isolate").get$isUsed() || $globals.wo
rld.coreimpl.types.$index("ReceivePortImpl").get$isUsed()) { |
| 2838 if (this.corejs.useWrap0 || this.corejs.useWrap1) { | 2830 if (this.corejs.useWrap0 || this.corejs.useWrap1) { |
| 2839 this.genMethod($globals.world.coreimpl.types.$index("IsolateContext").getM
ember$1("eval")); | 2831 this.genMethod($globals.world.coreimpl.types.$index("IsolateContext").getM
ember$1("eval")); |
| 2840 this.genMethod($globals.world.coreimpl.types.$index("EventLoop").getMember
$1("run")); | 2832 this.genMethod($globals.world.coreimpl.types.$index("EventLoop").getMember
$1("run")); |
| 2841 } | 2833 } |
| 2842 this.corejs.useIsolates = true; | 2834 this.corejs.useIsolates = true; |
| 2843 var isolateMain = $globals.world.coreimpl.lookup("startRootIsolate", this.ma
in.get$span()); | 2835 var isolateMain = $globals.world.coreimpl.topType.resolveMember("startRootIs
olate").members.$index((0)); |
| 2844 var isolateMainTarget = new TypeValue($globals.world.coreimpl.topType, this.
main.get$span()); | 2836 var isolateMainTarget = new TypeValue($globals.world.coreimpl.topType, this.
main.get$span()); |
| 2845 mainCall = isolateMain.invoke(metaGen, null, isolateMainTarget, new Argument
s(null, [this.main._get(metaGen, this.main.definition, null, false)]), false); | 2837 mainCall = isolateMain.invoke(metaGen, null, isolateMainTarget, new Argument
s(null, [this.main._get(metaGen, this.main.definition, null, false)]), false); |
| 2846 } | 2838 } |
| 2847 this.writeTypes($globals.world.coreimpl); | 2839 this.writeTypes($globals.world.coreimpl); |
| 2848 this.writeTypes($globals.world.corelib); | 2840 this.writeTypes($globals.world.corelib); |
| 2849 this.writeTypes(this.main.declaringType.get$library()); | 2841 this.writeTypes(this.main.declaringType.get$library()); |
| 2850 if (this._mixins != null) this.writer.write(this._mixins.get$text()); | 2842 if (this._mixins != null) this.writer.write(this._mixins.get$text()); |
| 2851 this.writeDynamicDispatchMetadata(); | 2843 this.writeDynamicDispatchMetadata(); |
| 2852 this.writeGlobals(); | 2844 this.writeGlobals(); |
| 2853 this.writer.writeln(("" + mainCall.get$code() + ";")); | 2845 this.writer.writeln(("" + mainCall.get$code() + ";")); |
| 2854 } | 2846 } |
| 2855 WorldGenerator.prototype.markLibrariesUsed = function(libs) { | 2847 WorldGenerator.prototype.markLibrariesUsed = function(libs) { |
| 2856 return this.getAllTypes(libs).forEach(this.get$markTypeUsed()); | 2848 return this.getAllTypes(libs).forEach(this.get$markTypeUsed()); |
| 2857 } | 2849 } |
| 2858 WorldGenerator.prototype.markTypeUsed = function(type) { | 2850 WorldGenerator.prototype.markTypeUsed = function(type) { |
| 2859 if (!type.get$isClass()) return; | 2851 if (!type.get$isClass()) return; |
| 2860 type.markUsed(); | 2852 type.markUsed(); |
| 2861 type.isTested = true; | 2853 type.isTested = true; |
| 2862 type.isTested = !type.get$isTop() && !(type.get$isNative() && type.get$members
().getValues().every((function (m) { | 2854 type.isTested = !type.get$isTop() && !(type.get$isNative() && type.get$members
().getValues$0().every$1((function (m) { |
| 2863 return m.get$isStatic() && !m.get$isFactory(); | 2855 return m.get$isStatic() && !m.get$isFactory(); |
| 2864 }) | 2856 }) |
| 2865 )); | 2857 )); |
| 2866 var members = ListFactory.ListFactory$from$factory(type.get$members().getValue
s()); | 2858 var members = ListFactory.ListFactory$from$factory(type.get$members().getValue
s$0()); |
| 2867 members.addAll$1(type.get$constructors().getValues()); | 2859 members.addAll$1(type.get$constructors().getValues$0()); |
| 2868 type.get$factories().forEach((function (f) { | 2860 type.get$factories().forEach((function (f) { |
| 2869 return members.add$1(f); | 2861 return members.add$1(f); |
| 2870 }) | 2862 }) |
| 2871 ); | 2863 ); |
| 2872 for (var $$i = members.iterator$0(); $$i.hasNext$0(); ) { | 2864 for (var $$i = members.iterator$0(); $$i.hasNext$0(); ) { |
| 2873 var member = $$i.next$0(); | 2865 var member = $$i.next$0(); |
| 2874 if ((member instanceof PropertyMember)) { | 2866 if ((member instanceof PropertyMember)) { |
| 2875 if (member.get$getter() != null) this.genMethod(member.get$getter()); | 2867 if (member.get$getter() != null) this.genMethod(member.get$getter()); |
| 2876 if (member.get$setter() != null) this.genMethod(member.get$setter()); | 2868 if (member.get$setter() != null) this.genMethod(member.get$setter()); |
| 2877 } | 2869 } |
| 2878 if ((member instanceof MethodMember)) this.genMethod(member); | 2870 if ((member instanceof MethodMember)) this.genMethod(member); |
| 2879 } | 2871 } |
| 2880 } | 2872 } |
| 2881 WorldGenerator.prototype.get$markTypeUsed = function() { | 2873 WorldGenerator.prototype.get$markTypeUsed = function() { |
| 2882 return this.markTypeUsed.bind(this); | 2874 return this.markTypeUsed.bind(this); |
| 2883 } | 2875 } |
| 2884 WorldGenerator.prototype.getAllTypes = function(libs) { | 2876 WorldGenerator.prototype.getAllTypes = function(libs) { |
| 2885 var types = []; | 2877 var types = []; |
| 2886 var seen = new HashSetImplementation(); | 2878 var seen = new HashSetImplementation(); |
| 2887 for (var $$i = 0;$$i < libs.get$length(); $$i++) { | 2879 for (var $$i = 0;$$i < libs.get$length(); $$i++) { |
| 2888 var mainLib = libs[$$i]; | 2880 var mainLib = libs.$index($$i); |
| 2889 var toCheck = DoubleLinkedQueue.DoubleLinkedQueue$from$factory([mainLib]); | 2881 var toCheck = DoubleLinkedQueue.DoubleLinkedQueue$from$factory([mainLib]); |
| 2890 while (!toCheck.isEmpty()) { | 2882 while (!toCheck.isEmpty()) { |
| 2891 var lib = toCheck.removeFirst(); | 2883 var lib = toCheck.removeFirst$0(); |
| 2892 if (seen.contains(lib)) continue; | 2884 if (seen.contains(lib)) continue; |
| 2893 seen.add(lib); | 2885 seen.add(lib); |
| 2894 lib.get$imports().forEach$1((function (lib, toCheck, i) { | 2886 lib.get$imports().forEach$1((function (lib, toCheck, i) { |
| 2895 return toCheck.addLast(lib); | 2887 return toCheck.addLast(lib); |
| 2896 }).bind(null, lib, toCheck) | 2888 }).bind(null, lib, toCheck) |
| 2897 ); | 2889 ); |
| 2898 lib.get$types().getValues$0().forEach$1((function (t) { | 2890 lib.get$types().getValues$0().forEach$1((function (t) { |
| 2899 return types.add(t); | 2891 return types.add(t); |
| 2900 }) | 2892 }) |
| 2901 ); | 2893 ); |
| 2902 } | 2894 } |
| 2903 } | 2895 } |
| 2904 return types; | 2896 return types; |
| 2905 } | 2897 } |
| 2906 WorldGenerator.prototype.globalForStaticField = function(field, exp, dependencie
s) { | 2898 WorldGenerator.prototype.globalForStaticField = function(field, exp, dependencie
s) { |
| 2907 this.hasStatics = true; | 2899 this.hasStatics = true; |
| 2908 var key = ("" + field.declaringType.get$jsname() + "." + field.get$jsname()); | 2900 var key = ("" + field.declaringType.get$jsname() + "." + field.get$jsname()); |
| 2909 var ret = this.globals.$index(key); | 2901 var ret = this.globals.$index(key); |
| 2910 if (ret == null) { | 2902 if (ret == null) { |
| 2911 ret = new GlobalValue(exp.get$type(), exp.get$code(), field.isFinal, field,
null, exp, exp.span, dependencies); | 2903 ret = new GlobalValue(exp.get$type(), exp.get$code(), field.isFinal, field,
null, exp, exp.span, dependencies); |
| 2912 this.globals.$setindex(key, ret); | 2904 this.globals.$setindex(key, ret); |
| 2913 } | 2905 } |
| 2914 return ret; | 2906 return ret; |
| 2915 } | 2907 } |
| 2916 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { | 2908 WorldGenerator.prototype.globalForConst = function(exp, dependencies) { |
| 2917 var key = exp.get$type().get$jsname() + ":" + exp.get$code(); | 2909 var key = exp.get$type().get$jsname() + ":" + exp.get$code(); |
| 2918 var ret = this.globals.$index(key); | 2910 var ret = this.globals.$index(key); |
| 2919 if (ret == null) { | 2911 if (ret == null) { |
| 2920 var ns = this.globals.get$length().toString$0(); | 2912 var ns = this.globals.get$length().toString(); |
| 2921 while (ns.get$length() < (4)) ns = "0" + ns; | 2913 while (ns.get$length() < (4)) ns = "0" + ns; |
| 2922 var name = ("const$" + ns); | 2914 var name = ("const$" + ns); |
| 2923 ret = new GlobalValue(exp.get$type(), name, true, null, name, exp, exp.span,
dependencies); | 2915 ret = new GlobalValue(exp.get$type(), name, true, null, name, exp, exp.span,
dependencies); |
| 2924 this.globals.$setindex(key, ret); | 2916 this.globals.$setindex(key, ret); |
| 2925 } | 2917 } |
| 2926 return ret; | 2918 return ret; |
| 2927 } | 2919 } |
| 2928 WorldGenerator.prototype.writeTypes = function(lib) { | 2920 WorldGenerator.prototype.writeTypes = function(lib) { |
| 2929 if (lib.isWritten) return; | 2921 if (lib.isWritten) return; |
| 2930 lib.isWritten = true; | 2922 lib.isWritten = true; |
| 2931 var $$list = lib.imports; | 2923 var $$list = lib.imports; |
| 2932 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2924 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2933 var import_ = $$list[$$i]; | 2925 var import_ = $$list.$index($$i); |
| 2934 this.writeTypes(import_.get$library()); | 2926 this.writeTypes(import_.get$library()); |
| 2935 } | 2927 } |
| 2936 for (var i = (0); | 2928 for (var i = (0); |
| 2937 i < lib.sources.get$length(); i++) { | 2929 i < lib.sources.get$length(); i++) { |
| 2938 lib.sources[i].set$orderInLibrary(i); | 2930 lib.sources.$index(i).set$orderInLibrary(i); |
| 2939 } | 2931 } |
| 2940 this.writer.comment(("// ********** Library " + lib.name + " **************")
); | 2932 this.writer.comment(("// ********** Library " + lib.name + " **************")
); |
| 2941 if (lib.get$isCore()) { | 2933 if (lib.get$isCore()) { |
| 2942 this.writer.comment("// ********** Natives dart:core **************"); | 2934 this.writer.comment("// ********** Natives dart:core **************"); |
| 2943 this.corejs.generate(this.writer); | 2935 this.corejs.generate(this.writer); |
| 2944 } | 2936 } |
| 2945 var $$list = lib.natives; | 2937 var $$list = lib.natives; |
| 2946 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 2938 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2947 var file = $$list[$$i]; | 2939 var file = $$list.$index($$i); |
| 2948 var filename = basename(file.get$filename()); | 2940 var filename = basename(file.get$filename()); |
| 2949 this.writer.comment(("// ********** Natives " + filename + " **************
")); | 2941 this.writer.comment(("// ********** Natives " + filename + " **************
")); |
| 2950 this.writer.writeln(file.get$text()); | 2942 this.writer.writeln(file.get$text()); |
| 2951 } | 2943 } |
| 2952 lib.topType.markUsed(); | 2944 lib.topType.markUsed(); |
| 2953 var orderedTypes = this._orderValues(lib.types); | 2945 var $$list = this._orderValues(lib.types); |
| 2954 for (var $$i = orderedTypes.iterator$0(); $$i.hasNext$0(); ) { | 2946 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 2955 var type = $$i.next$0(); | 2947 var type = $$list.$index($$i); |
| 2956 if ((type.get$library().get$isDom() || type.get$isHiddenNativeType()) && typ
e.get$isClass()) { | 2948 if ((type.get$isUsed() || type.get$library().get$isDom() || type.get$isHidde
nNativeType()) && type.get$isClass()) { |
| 2957 type.markUsed$0(); | |
| 2958 } | |
| 2959 } | |
| 2960 for (var $$i = orderedTypes.iterator$0(); $$i.hasNext$0(); ) { | |
| 2961 var type = $$i.next$0(); | |
| 2962 if (type.get$isUsed() && type.get$isClass()) { | |
| 2963 this.writeType(type); | 2949 this.writeType(type); |
| 2964 if (type.get$isGeneric()) { | 2950 if (type.get$isGeneric()) { |
| 2965 var $$list = this._orderValues(type.get$_concreteTypes()); | 2951 var $list0 = this._orderValues(type.get$_concreteTypes()); |
| 2966 for (var $i0 = 0;$i0 < $$list.get$length(); $i0++) { | 2952 for (var $i0 = 0;$i0 < $list0.get$length(); $i0++) { |
| 2967 var ct = $$list[$i0]; | 2953 var ct = $list0.$index($i0); |
| 2968 this.writeType(ct); | 2954 this.writeType(ct); |
| 2969 } | 2955 } |
| 2970 } | 2956 } |
| 2971 } | 2957 } |
| 2972 else if (type.get$isFunction() && type.get$varStubs().get$length() > (0)) { | 2958 else if (type.get$isFunction() && type.get$varStubs().get$length() > (0)) { |
| 2973 this.writer.comment(("// ********** Code for " + type.get$jsname() + " ***
***********")); | 2959 this.writer.comment(("// ********** Code for " + type.get$jsname() + " ***
***********")); |
| 2974 this._writeDynamicStubs(type); | 2960 this._writeDynamicStubs(type); |
| 2975 } | 2961 } |
| 2976 if (type.get$typeCheckCode() != null) { | 2962 if (type.get$typeCheckCode() != null) { |
| 2977 this.writer.writeln(type.get$typeCheckCode()); | 2963 this.writer.writeln(type.get$typeCheckCode()); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3092 else { | 3078 else { |
| 3093 var standardConstructor = type.get$constructors().$index(""); | 3079 var standardConstructor = type.get$constructors().$index(""); |
| 3094 if (standardConstructor == null || standardConstructor.generator == null) { | 3080 if (standardConstructor == null || standardConstructor.generator == null) { |
| 3095 if (!type.get$isNative()) { | 3081 if (!type.get$isNative()) { |
| 3096 this.writer.writeln(("function " + type.get$jsname() + "() {}")); | 3082 this.writer.writeln(("function " + type.get$jsname() + "() {}")); |
| 3097 } | 3083 } |
| 3098 } | 3084 } |
| 3099 else { | 3085 else { |
| 3100 standardConstructor.generator.writeDefinition(this.writer, null); | 3086 standardConstructor.generator.writeDefinition(this.writer, null); |
| 3101 } | 3087 } |
| 3102 var $$list = type.get$constructors().getValues(); | 3088 var $$list = type.get$constructors().getValues$0(); |
| 3103 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3089 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3104 var c = $$i.next$0(); | 3090 var c = $$i.next$0(); |
| 3105 if (c.get$generator() != null && $ne(c, standardConstructor)) { | 3091 if (c.get$generator() != null && $ne(c, standardConstructor)) { |
| 3106 c.get$generator().writeDefinition$2(this.writer); | 3092 c.get$generator().writeDefinition$2(this.writer); |
| 3107 } | 3093 } |
| 3108 } | 3094 } |
| 3109 } | 3095 } |
| 3110 if (!(type instanceof ConcreteType)) { | 3096 if (!(type instanceof ConcreteType)) { |
| 3111 this._maybeIsTest(type, type); | 3097 this._maybeIsTest(type, type); |
| 3112 } | 3098 } |
| 3113 if (type.get$genericType()._concreteTypes != null) { | 3099 if (type.get$genericType()._concreteTypes != null) { |
| 3114 var $$list = this._orderValues(type.get$genericType()._concreteTypes); | 3100 var $$list = this._orderValues(type.get$genericType()._concreteTypes); |
| 3115 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3101 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3116 var ct = $$list[$$i]; | 3102 var ct = $$list.$index($$i); |
| 3117 this._maybeIsTest(type, ct); | 3103 this._maybeIsTest(type, ct); |
| 3118 } | 3104 } |
| 3119 } | 3105 } |
| 3120 if (type.get$interfaces() != null) { | 3106 if (type.get$interfaces() != null) { |
| 3121 var seen = new HashSetImplementation(); | 3107 var seen = new HashSetImplementation(); |
| 3122 var worklist = []; | 3108 var worklist = []; |
| 3123 worklist.addAll$1(type.get$interfaces()); | 3109 worklist.addAll$1(type.get$interfaces()); |
| 3124 seen.addAll$1(type.get$interfaces()); | 3110 seen.addAll$1(type.get$interfaces()); |
| 3125 while (!worklist.isEmpty$0()) { | 3111 while (!worklist.isEmpty$0()) { |
| 3126 var interface_ = worklist.removeLast$0(); | 3112 var interface_ = worklist.removeLast$0(); |
| 3127 this._maybeIsTest(type, interface_.get$genericType()); | 3113 this._maybeIsTest(type, interface_.get$genericType()); |
| 3128 if (interface_.get$genericType().get$_concreteTypes() != null) { | 3114 if (interface_.get$genericType().get$_concreteTypes() != null) { |
| 3129 var $$list = this._orderValues(interface_.get$genericType().get$_concret
eTypes()); | 3115 var $$list = this._orderValues(interface_.get$genericType().get$_concret
eTypes()); |
| 3130 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3116 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3131 var ct = $$list[$$i]; | 3117 var ct = $$list.$index($$i); |
| 3132 this._maybeIsTest(type, ct); | 3118 this._maybeIsTest(type, ct); |
| 3133 } | 3119 } |
| 3134 } | 3120 } |
| 3135 var $$list = interface_.get$interfaces(); | 3121 var $$list = interface_.get$interfaces(); |
| 3136 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3122 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3137 var other = $$i.next$0(); | 3123 var other = $$i.next$0(); |
| 3138 if (!seen.contains$1(other)) { | 3124 if (!seen.contains$1(other)) { |
| 3139 worklist.addLast$1(other); | 3125 worklist.addLast$1(other); |
| 3140 seen.add$1(other); | 3126 seen.add$1(other); |
| 3141 } | 3127 } |
| 3142 } | 3128 } |
| 3143 } | 3129 } |
| 3144 } | 3130 } |
| 3145 type.get$factories().forEach(this.get$_writeMethod()); | 3131 type.get$factories().forEach(this.get$_writeMethod()); |
| 3146 var $$list = this._orderValues(type.get$members()); | 3132 var $$list = this._orderValues(type.get$members()); |
| 3147 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3133 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3148 var member = $$list[$$i]; | 3134 var member = $$list.$index($$i); |
| 3149 if ((member instanceof FieldMember)) { | 3135 if ((member instanceof FieldMember)) { |
| 3150 this._writeField(member); | 3136 this._writeField(member); |
| 3151 } | 3137 } |
| 3152 if ((member instanceof PropertyMember)) { | 3138 if ((member instanceof PropertyMember)) { |
| 3153 this._writeProperty(member); | 3139 this._writeProperty(member); |
| 3154 } | 3140 } |
| 3155 if (member.get$isMethod()) { | 3141 if (member.get$isMethod()) { |
| 3156 this._writeMethod(member); | 3142 this._writeMethod(member); |
| 3157 } | 3143 } |
| 3158 } | 3144 } |
| 3159 this._writeDynamicStubs(type); | 3145 this._writeDynamicStubs(type); |
| 3160 } | 3146 } |
| 3161 WorldGenerator.prototype._typeNeedsHolderForStaticMethods = function(type) { | 3147 WorldGenerator.prototype._typeNeedsHolderForStaticMethods = function(type) { |
| 3162 var $$list = type.get$members().getValues(); | 3148 var $$list = type.get$members().getValues$0(); |
| 3163 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 3149 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 3164 var member = $$i.next$0(); | 3150 var member = $$i.next$0(); |
| 3165 if (member.get$isMethod()) { | 3151 if (member.get$isMethod()) { |
| 3166 if (member.get$isConstructor() || member.get$isStatic()) { | 3152 if (member.get$isConstructor() || member.get$isStatic()) { |
| 3167 if (member.get$isGenerated()) { | 3153 if (member.get$isGenerated()) { |
| 3168 return true; | 3154 return true; |
| 3169 } | 3155 } |
| 3170 } | 3156 } |
| 3171 } | 3157 } |
| 3172 } | 3158 } |
| 3173 return false; | 3159 return false; |
| 3174 } | 3160 } |
| 3175 WorldGenerator.prototype._ensureInheritMembersHelper = function() { | 3161 WorldGenerator.prototype._ensureInheritMembersHelper = function() { |
| 3176 if (this._mixins != null) return; | 3162 if (this._mixins != null) return; |
| 3177 this._mixins = new CodeWriter(); | 3163 this._mixins = new CodeWriter(); |
| 3178 this._mixins.comment("// ********** Generic Type Inheritance **************"); | 3164 this._mixins.comment("// ********** Generic Type Inheritance **************"); |
| 3179 this._mixins.writeln("/** Implements extends for generic types. */\nfunction $
inheritsMembers(child, parent) {\n child = child.prototype;\n parent = parent.
prototype;\n Object.getOwnPropertyNames(parent).forEach(function(name) {\n i
f (typeof(child[name]) == 'undefined') child[name] = parent[name];\n });\n}"); | 3165 this._mixins.writeln("/** Implements extends for generic types. */\nfunction $
inheritsMembers(child, parent) {\n child = child.prototype;\n parent = parent.
prototype;\n Object.getOwnPropertyNames(parent).forEach(function(name) {\n i
f (typeof(child[name]) == 'undefined') child[name] = parent[name];\n });\n}"); |
| 3180 } | 3166 } |
| 3181 WorldGenerator.prototype._writeDynamicStubs = function(type) { | 3167 WorldGenerator.prototype._writeDynamicStubs = function(type) { |
| 3182 var $$list = orderValuesByKeys(type.varStubs); | 3168 var $$list = orderValuesByKeys(type.varStubs); |
| 3183 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3169 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3184 var stub = $$list[$$i]; | 3170 var stub = $$list.$index($$i); |
| 3185 if (!stub.get$isGenerated()) stub.generate$1(this.writer); | 3171 if (!stub.get$isGenerated()) stub.generate$1(this.writer); |
| 3186 } | 3172 } |
| 3187 } | 3173 } |
| 3188 WorldGenerator.prototype._writeStaticField = function(field) { | 3174 WorldGenerator.prototype._writeStaticField = function(field) { |
| 3189 if (field.isFinal) return; | 3175 if (field.isFinal) return; |
| 3190 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname
()); | 3176 var fullname = ("" + field.declaringType.get$jsname() + "." + field.get$jsname
()); |
| 3191 if (this.globals.containsKey(fullname)) { | 3177 if (this.globals.containsKey(fullname)) { |
| 3192 var value = this.globals.$index(fullname); | 3178 var value = this.globals.$index(fullname); |
| 3193 if (field.declaringType.get$isTop() && !field.isNative) { | 3179 if (field.declaringType.get$isTop() && !field.isNative) { |
| 3194 this.writer.writeln(("$globals." + field.get$jsname() + " = " + value.get$
exp().get$code() + ";")); | 3180 this.writer.writeln(("$globals." + field.get$jsname() + " = " + value.get$
exp().get$code() + ";")); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3231 else if ((m instanceof MethodMember) && m.get$isNative() && m._provideProperty
Syntax && !m._provideFieldSyntax) { | 3217 else if ((m instanceof MethodMember) && m.get$isNative() && m._provideProperty
Syntax && !m._provideFieldSyntax) { |
| 3232 MethodGenerator._maybeGenerateBoundGetter(m, this.writer); | 3218 MethodGenerator._maybeGenerateBoundGetter(m, this.writer); |
| 3233 } | 3219 } |
| 3234 } | 3220 } |
| 3235 WorldGenerator.prototype.get$_writeMethod = function() { | 3221 WorldGenerator.prototype.get$_writeMethod = function() { |
| 3236 return this._writeMethod.bind(this); | 3222 return this._writeMethod.bind(this); |
| 3237 } | 3223 } |
| 3238 WorldGenerator.prototype.writeGlobals = function() { | 3224 WorldGenerator.prototype.writeGlobals = function() { |
| 3239 if (this.globals.get$length() > (0)) { | 3225 if (this.globals.get$length() > (0)) { |
| 3240 this.writer.comment("// ********** Globals **************"); | 3226 this.writer.comment("// ********** Globals **************"); |
| 3241 var list = this.globals.getValues(); | 3227 var list = this.globals.getValues$0(); |
| 3242 list.sort$1((function (a, b) { | 3228 list.sort$1((function (a, b) { |
| 3243 return a.compareTo$1(b); | 3229 return a.compareTo$1(b); |
| 3244 }) | 3230 }) |
| 3245 ); | 3231 ); |
| 3246 this.writer.enterBlock("function $static_init(){"); | 3232 this.writer.enterBlock("function $static_init(){"); |
| 3247 for (var $$i = list.iterator$0(); $$i.hasNext$0(); ) { | 3233 for (var $$i = list.iterator$0(); $$i.hasNext$0(); ) { |
| 3248 var global = $$i.next$0(); | 3234 var global = $$i.next$0(); |
| 3249 if (global.get$field() != null) { | 3235 if (global.get$field() != null) { |
| 3250 this._writeStaticField(global.get$field()); | 3236 this._writeStaticField(global.get$field()); |
| 3251 } | 3237 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 3275 var $this = this; // closure support | 3261 var $this = this; // closure support |
| 3276 if (this.typesWithDynamicDispatch == null) return; | 3262 if (this.typesWithDynamicDispatch == null) return; |
| 3277 this.writer.comment(("// " + this.typesWithDynamicDispatch.get$length() + " dy
namic types.")); | 3263 this.writer.comment(("// " + this.typesWithDynamicDispatch.get$length() + " dy
namic types.")); |
| 3278 var seen = new HashSetImplementation(); | 3264 var seen = new HashSetImplementation(); |
| 3279 var types = []; | 3265 var types = []; |
| 3280 function visit(type) { | 3266 function visit(type) { |
| 3281 if (seen.contains$1(type)) return; | 3267 if (seen.contains$1(type)) return; |
| 3282 seen.add$1(type); | 3268 seen.add$1(type); |
| 3283 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); | 3269 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); |
| 3284 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3270 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3285 var subtype = $$list[$$i]; | 3271 var subtype = $$list.$index($$i); |
| 3286 visit.call$1(subtype); | 3272 visit(subtype); |
| 3287 } | 3273 } |
| 3288 types.add$1(type); | 3274 types.add$1(type); |
| 3289 } | 3275 } |
| 3290 var $$list = this._orderCollectionValues(this.typesWithDynamicDispatch); | 3276 var $$list = this._orderCollectionValues(this.typesWithDynamicDispatch); |
| 3291 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3277 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3292 var type = $$list[$$i]; | 3278 var type = $$list.$index($$i); |
| 3293 visit.call$1(type); | 3279 visit(type); |
| 3294 } | 3280 } |
| 3295 var dispatchTypes = types.filter$1((function (type) { | 3281 var dispatchTypes = types.filter$1((function (type) { |
| 3296 return !type.get$directSubtypes().isEmpty$0() && $this.typesWithDynamicDispa
tch.contains(type); | 3282 return !type.get$directSubtypes().isEmpty$0() && $this.typesWithDynamicDispa
tch.contains(type); |
| 3297 }) | 3283 }) |
| 3298 ); | 3284 ); |
| 3299 this.writer.comment(("// " + types.get$length() + " types")); | 3285 this.writer.comment(("// " + types.get$length() + " types")); |
| 3300 this.writer.comment(("// " + types.filter$1((function (t) { | 3286 this.writer.comment(("// " + types.filter$1((function (t) { |
| 3301 return !t.get$directSubtypes().isEmpty$0(); | 3287 return !t.get$directSubtypes().isEmpty$0(); |
| 3302 }) | 3288 }) |
| 3303 ).get$length() + " !leaf")); | 3289 ).get$length() + " !leaf")); |
| 3304 var varNames = []; | 3290 var varNames = []; |
| 3305 var varDefns = new HashMapImplementation(); | 3291 var varDefns = new HashMapImplementation(); |
| 3306 var tagDefns = new HashMapImplementation(); | 3292 var tagDefns = new HashMapImplementation(); |
| 3307 function makeExpression(type) { | 3293 function makeExpression(type) { |
| 3308 var expressions = []; | 3294 var expressions = []; |
| 3309 var subtags = [type.get$nativeName()]; | 3295 var subtags = [type.get$nativeName()]; |
| 3310 function walk(type) { | 3296 function walk(type) { |
| 3311 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); | 3297 var $$list = $this._orderCollectionValues(type.get$directSubtypes()); |
| 3312 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3298 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3313 var subtype = $$list[$$i]; | 3299 var subtype = $$list.$index($$i); |
| 3314 var tag = subtype.get$nativeName(); | 3300 var tag = subtype.get$nativeName(); |
| 3315 var existing = tagDefns.$index(tag); | 3301 var existing = tagDefns.$index(tag); |
| 3316 if (existing == null) { | 3302 if (existing == null) { |
| 3317 subtags.add$1(tag); | 3303 subtags.add$1(tag); |
| 3318 walk.call$1(subtype); | 3304 walk(subtype); |
| 3319 } | 3305 } |
| 3320 else { | 3306 else { |
| 3321 if (varDefns.containsKey$1(existing)) { | 3307 if (varDefns.containsKey$1(existing)) { |
| 3322 expressions.add$1(existing); | 3308 expressions.add$1(existing); |
| 3323 } | 3309 } |
| 3324 else { | 3310 else { |
| 3325 var varName = ("v" + varNames.get$length() + "/*" + tag + "*/"); | 3311 var varName = ("v" + varNames.get$length() + "/*" + tag + "*/"); |
| 3326 varNames.add$1(varName); | 3312 varNames.add$1(varName); |
| 3327 varDefns.$setindex(varName, existing); | 3313 varDefns.$setindex(varName, existing); |
| 3328 tagDefns.$setindex(tag, varName); | 3314 tagDefns.$setindex(tag, varName); |
| 3329 expressions.add$1(varName); | 3315 expressions.add$1(varName); |
| 3330 } | 3316 } |
| 3331 } | 3317 } |
| 3332 } | 3318 } |
| 3333 } | 3319 } |
| 3334 walk.call$1(type); | 3320 walk(type); |
| 3335 var constantPart = ("'" + Strings.join(subtags, "|") + "'"); | 3321 var constantPart = ("'" + Strings.join(subtags, "|") + "'"); |
| 3336 if ($ne(constantPart, "''")) expressions.add$1(constantPart); | 3322 if ($ne(constantPart, "''")) expressions.add$1(constantPart); |
| 3337 var expression; | 3323 var expression; |
| 3338 if ($eq(expressions.get$length(), (1))) { | 3324 if ($eq(expressions.get$length(), (1))) { |
| 3339 expression = expressions.$index((0)); | 3325 expression = expressions.$index((0)); |
| 3340 } | 3326 } |
| 3341 else { | 3327 else { |
| 3342 expression = ("[" + Strings.join(expressions, ",") + "].join('|')"); | 3328 expression = ("[" + Strings.join(expressions, ",") + "].join('|')"); |
| 3343 } | 3329 } |
| 3344 return expression; | 3330 return expression; |
| 3345 } | 3331 } |
| 3346 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { | 3332 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { |
| 3347 var type = $$i.next$0(); | 3333 var type = $$i.next$0(); |
| 3348 tagDefns.$setindex(type.get$nativeName(), makeExpression.call$1(type)); | 3334 tagDefns.$setindex(type.get$nativeName(), makeExpression(type)); |
| 3349 } | 3335 } |
| 3350 if (!tagDefns.isEmpty$0()) { | 3336 if (!tagDefns.isEmpty$0()) { |
| 3351 this.writer.enterBlock("(function(){"); | 3337 this.writer.enterBlock("(function(){"); |
| 3352 for (var $$i = varNames.iterator$0(); $$i.hasNext$0(); ) { | 3338 for (var $$i = varNames.iterator$0(); $$i.hasNext$0(); ) { |
| 3353 var varName = $$i.next$0(); | 3339 var varName = $$i.next$0(); |
| 3354 this.writer.writeln(("var " + varName + " = " + varDefns.$index(varName) +
";")); | 3340 this.writer.writeln(("var " + varName + " = " + varDefns.$index(varName) +
";")); |
| 3355 } | 3341 } |
| 3356 this.writer.enterBlock("var table = ["); | 3342 this.writer.enterBlock("var table = ["); |
| 3357 this.writer.comment("// [dynamic-dispatch-tag, tags of classes implementing
dynamic-dispatch-tag]"); | 3343 this.writer.comment("// [dynamic-dispatch-tag, tags of classes implementing
dynamic-dispatch-tag]"); |
| 3358 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { | 3344 for (var $$i = dispatchTypes.iterator$0(); $$i.hasNext$0(); ) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3423 } | 3409 } |
| 3424 MethodGenerator.prototype.get$isStatic = function() { | 3410 MethodGenerator.prototype.get$isStatic = function() { |
| 3425 return this.method.get$isStatic(); | 3411 return this.method.get$isStatic(); |
| 3426 } | 3412 } |
| 3427 MethodGenerator.prototype.getTemp = function(value) { | 3413 MethodGenerator.prototype.getTemp = function(value) { |
| 3428 return value.get$needsTemp() ? this.forceTemp(value) : value; | 3414 return value.get$needsTemp() ? this.forceTemp(value) : value; |
| 3429 } | 3415 } |
| 3430 MethodGenerator.prototype.forceTemp = function(value) { | 3416 MethodGenerator.prototype.forceTemp = function(value) { |
| 3431 var name; | 3417 var name; |
| 3432 if (this._freeTemps.get$length() > (0)) { | 3418 if (this._freeTemps.get$length() > (0)) { |
| 3433 name = this._freeTemps.removeLast(); | 3419 name = this._freeTemps.removeLast$0(); |
| 3434 } | 3420 } |
| 3435 else { | 3421 else { |
| 3436 name = "$" + this._usedTemps.get$length(); | 3422 name = "$" + this._usedTemps.get$length(); |
| 3437 } | 3423 } |
| 3438 this._usedTemps.add(name); | 3424 this._usedTemps.add(name); |
| 3439 return new VariableValue(value.get$staticType(), name, value.span, false, valu
e); | 3425 return new VariableValue(value.get$staticType(), name, value.span, false, valu
e); |
| 3440 } | 3426 } |
| 3441 MethodGenerator.prototype.assignTemp = function(tmp, v) { | 3427 MethodGenerator.prototype.assignTemp = function(tmp, v) { |
| 3442 if ($eq(tmp, v)) { | 3428 if ($eq(tmp, v)) { |
| 3443 return v; | 3429 return v; |
| 3444 } | 3430 } |
| 3445 else { | 3431 else { |
| 3446 return new Value(v.get$type(), ("(" + tmp.get$code() + " = " + v.get$code()
+ ")"), v.span); | 3432 return new Value(v.get$type(), ("(" + tmp.get$code() + " = " + v.get$code()
+ ")"), v.span); |
| 3447 } | 3433 } |
| 3448 } | 3434 } |
| 3449 MethodGenerator.prototype.freeTemp = function(value) { | 3435 MethodGenerator.prototype.freeTemp = function(value) { |
| 3450 | 3436 if (this._usedTemps.remove(value.code)) { |
| 3437 this._freeTemps.add(value.code); |
| 3438 } |
| 3439 else { |
| 3440 $globals.world.internalError(("tried to free unused value or non-temp \"" +
value.code + "\"")); |
| 3441 } |
| 3451 } | 3442 } |
| 3452 MethodGenerator.prototype.run = function() { | 3443 MethodGenerator.prototype.run = function() { |
| 3453 if (this.method.isGenerated) return; | 3444 if (this.method.isGenerated) return; |
| 3454 this.method.isGenerated = true; | 3445 this.method.isGenerated = true; |
| 3455 this.method.generator = this; | 3446 this.method.generator = this; |
| 3456 var thisObject; | 3447 var thisObject; |
| 3457 if (this.method.get$isConstructor()) { | 3448 if (this.method.get$isConstructor()) { |
| 3458 thisObject = new ObjectValue(false, this.method.declaringType, this.method.g
et$span()); | 3449 thisObject = new ObjectValue(false, this.method.declaringType, this.method.g
et$span()); |
| 3459 thisObject.initFields$0(); | 3450 thisObject.initFields$0(); |
| 3460 } | 3451 } |
| 3461 else { | 3452 else { |
| 3462 thisObject = new Value(this.method.declaringType, "this", null); | 3453 thisObject = new Value(this.method.declaringType, "this", null); |
| 3463 } | 3454 } |
| 3464 var values = []; | 3455 var values = []; |
| 3465 var $$list = this.method.get$parameters(); | 3456 var $$list = this.method.get$parameters(); |
| 3466 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3457 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3467 var p = $$list[$$i]; | 3458 var p = $$list.$index($$i); |
| 3468 values.add$1(new Value(p.get$type(), p.get$name(), null)); | 3459 values.add$1(new Value(p.get$type(), p.get$name(), null)); |
| 3469 } | 3460 } |
| 3470 var args = new Arguments(null, values); | 3461 var args = new Arguments(null, values); |
| 3471 this.evalBody(thisObject, args); | 3462 this.evalBody(thisObject, args); |
| 3472 if (this.method.get$definition().get$nativeBody() != null) { | 3463 if (this.method.get$definition().get$nativeBody() != null) { |
| 3473 this.writer = new CodeWriter(); | 3464 this.writer = new CodeWriter(); |
| 3474 if ($eq(this.method.get$definition().get$nativeBody(), "")) { | 3465 if ($eq(this.method.get$definition().get$nativeBody(), "")) { |
| 3475 this.method.generator = null; | 3466 this.method.generator = null; |
| 3476 } | 3467 } |
| 3477 else { | 3468 else { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3575 } | 3566 } |
| 3576 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { | 3567 MethodGenerator.prototype._provideOptionalParamInfo = function(defWriter) { |
| 3577 if ((this.method instanceof MethodMember)) { | 3568 if ((this.method instanceof MethodMember)) { |
| 3578 var meth = this.method; | 3569 var meth = this.method; |
| 3579 if (meth._provideOptionalParamInfo) { | 3570 if (meth._provideOptionalParamInfo) { |
| 3580 var optNames = []; | 3571 var optNames = []; |
| 3581 var optValues = []; | 3572 var optValues = []; |
| 3582 meth.genParameterValues(); | 3573 meth.genParameterValues(); |
| 3583 var $$list = meth.parameters; | 3574 var $$list = meth.parameters; |
| 3584 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3575 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3585 var param = $$list[$$i]; | 3576 var param = $$list.$index($$i); |
| 3586 if (param.get$isOptional()) { | 3577 if (param.get$isOptional()) { |
| 3587 optNames.add$1(param.get$name()); | 3578 optNames.add$1(param.get$name()); |
| 3588 optValues.add$1(MethodGenerator._escapeString(param.get$value().get$co
de())); | 3579 optValues.add$1(MethodGenerator._escapeString(param.get$value().get$co
de())); |
| 3589 } | 3580 } |
| 3590 } | 3581 } |
| 3591 if (optNames.get$length() > (0)) { | 3582 if (optNames.get$length() > (0)) { |
| 3592 var start = ""; | 3583 var start = ""; |
| 3593 if (meth.isStatic) { | 3584 if (meth.isStatic) { |
| 3594 if (!meth.declaringType.get$isTop()) { | 3585 if (!meth.declaringType.get$isTop()) { |
| 3595 start = meth.declaringType.get$jsname() + "."; | 3586 start = meth.declaringType.get$jsname() + "."; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 3616 return newObject.setField(field, value, true); | 3607 return newObject.setField(field, value, true); |
| 3617 } | 3608 } |
| 3618 MethodGenerator.prototype.evalBody = function(newObject, args) { | 3609 MethodGenerator.prototype.evalBody = function(newObject, args) { |
| 3619 var fieldsSet = false; | 3610 var fieldsSet = false; |
| 3620 if (this.method.get$isNative() && this.method.get$isConstructor() && (newObjec
t instanceof ObjectValue)) { | 3611 if (this.method.get$isNative() && this.method.get$isConstructor() && (newObjec
t instanceof ObjectValue)) { |
| 3621 newObject.get$dynamic().set$seenNativeInitializer(true); | 3612 newObject.get$dynamic().set$seenNativeInitializer(true); |
| 3622 } | 3613 } |
| 3623 this._paramCode = []; | 3614 this._paramCode = []; |
| 3624 for (var i = (0); | 3615 for (var i = (0); |
| 3625 i < this.method.get$parameters().get$length(); i++) { | 3616 i < this.method.get$parameters().get$length(); i++) { |
| 3626 var p = this.method.get$parameters()[i]; | 3617 var p = this.method.get$parameters().$index(i); |
| 3627 var currentArg = null; | 3618 var currentArg = null; |
| 3628 if (i < args.get$bareCount()) { | 3619 if (i < args.get$bareCount()) { |
| 3629 currentArg = args.values[i]; | 3620 currentArg = args.values.$index(i); |
| 3630 } | 3621 } |
| 3631 else { | 3622 else { |
| 3632 currentArg = args.getValue(p.get$name()); | 3623 currentArg = args.getValue(p.get$name()); |
| 3633 if (currentArg == null) { | 3624 if (currentArg == null) { |
| 3634 p.genValue$2(this.method, this.method.generator); | 3625 p.genValue$2(this.method, this.method.generator); |
| 3635 currentArg = p.get$value(); | 3626 currentArg = p.get$value(); |
| 3636 } | 3627 } |
| 3637 } | 3628 } |
| 3638 if (p.get$isInitializer()) { | 3629 if (p.get$isInitializer()) { |
| 3639 this._paramCode.add(p.get$name()); | 3630 this._paramCode.add(p.get$name()); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3762 var value = m.invoke$4(this, node, target, newArgs); | 3753 var value = m.invoke$4(this, node, target, newArgs); |
| 3763 if ($ne(target.get$type(), $globals.world.objectType)) { | 3754 if ($ne(target.get$type(), $globals.world.objectType)) { |
| 3764 this.writer.writeln(("" + value.get$code() + ";")); | 3755 this.writer.writeln(("" + value.get$code() + ";")); |
| 3765 } | 3756 } |
| 3766 } | 3757 } |
| 3767 } | 3758 } |
| 3768 MethodGenerator.prototype._makeArgs = function(arguments) { | 3759 MethodGenerator.prototype._makeArgs = function(arguments) { |
| 3769 var args = []; | 3760 var args = []; |
| 3770 var seenLabel = false; | 3761 var seenLabel = false; |
| 3771 for (var $$i = 0;$$i < arguments.get$length(); $$i++) { | 3762 for (var $$i = 0;$$i < arguments.get$length(); $$i++) { |
| 3772 var arg = arguments[$$i]; | 3763 var arg = arguments.$index($$i); |
| 3773 if (arg.get$label() != null) { | 3764 if (arg.get$label() != null) { |
| 3774 seenLabel = true; | 3765 seenLabel = true; |
| 3775 } | 3766 } |
| 3776 else if (seenLabel) { | 3767 else if (seenLabel) { |
| 3777 $globals.world.error("bare argument can not follow named arguments", arg.g
et$span()); | 3768 $globals.world.error("bare argument can not follow named arguments", arg.g
et$span()); |
| 3778 } | 3769 } |
| 3779 args.add$1(this.visitValue(arg.get$value())); | 3770 args.add$1(this.visitValue(arg.get$value())); |
| 3780 } | 3771 } |
| 3781 return new Arguments(arguments, args); | 3772 return new Arguments(arguments, args); |
| 3782 } | 3773 } |
| 3783 MethodGenerator.prototype._invokeNative = function(name, arguments) { | 3774 MethodGenerator.prototype._invokeNative = function(name, arguments) { |
| 3784 var args = Arguments.get$EMPTY(); | 3775 var args = Arguments.get$EMPTY(); |
| 3785 if (arguments.get$length() > (0)) { | 3776 if (arguments.get$length() > (0)) { |
| 3786 args = new Arguments(null, arguments); | 3777 args = new Arguments(null, arguments); |
| 3787 } | 3778 } |
| 3788 var method = $globals.world.corelib.topType.members.$index(name); | 3779 var method = $globals.world.corelib.topType.members.$index(name); |
| 3789 return method.invoke$4(this, method.get$definition(), new Value($globals.world
.corelib.topType, null, null), args); | 3780 return method.invoke$4(this, method.get$definition(), new Value($globals.world
.corelib.topType, null, null), args); |
| 3790 } | 3781 } |
| 3791 MethodGenerator._escapeString = function(text) { | 3782 MethodGenerator._escapeString = function(text) { |
| 3792 return text.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n",
"\\n").replaceAll("\r", "\\r"); | 3783 return text.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n",
"\\n").replaceAll("\r", "\\r"); |
| 3793 } | 3784 } |
| 3794 MethodGenerator.prototype.visitStatementsInBlock = function(body) { | 3785 MethodGenerator.prototype.visitStatementsInBlock = function(body) { |
| 3795 if ((body instanceof BlockStatement)) { | 3786 if ((body instanceof BlockStatement)) { |
| 3796 var block = body; | 3787 var block = body; |
| 3797 var $$list = block.body; | 3788 var $$list = block.body; |
| 3798 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 3789 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 3799 var stmt = $$list[$$i]; | 3790 var stmt = $$list.$index($$i); |
| 3800 stmt.visit$1(this); | 3791 stmt.visit$1(this); |
| 3801 } | 3792 } |
| 3802 } | 3793 } |
| 3803 else { | 3794 else { |
| 3804 if (body != null) body.visit(this); | 3795 if (body != null) body.visit(this); |
| 3805 } | 3796 } |
| 3806 return false; | 3797 return false; |
| 3807 } | 3798 } |
| 3808 MethodGenerator.prototype._pushBlock = function(node, reentrant) { | 3799 MethodGenerator.prototype._pushBlock = function(node, reentrant) { |
| 3809 this._scope = new BlockScope(this, this._scope, node, reentrant); | 3800 this._scope = new BlockScope(this, this._scope, node, reentrant); |
| 3810 } | 3801 } |
| 3811 MethodGenerator.prototype._popBlock = function(node) { | 3802 MethodGenerator.prototype._popBlock = function(node) { |
| 3812 if (this._scope.node != node) { | 3803 if (this._scope.node != node) { |
| 3813 function spanOf(n) { | 3804 function spanOf(n) { |
| 3814 return n != null ? n.get$span() : null; | 3805 return n != null ? n.get$span() : null; |
| 3815 } | 3806 } |
| 3816 $globals.world.internalError(("scope mismatch. Trying to pop \"" + node + "\
" but found ") + (" \"" + this._scope.node + "\""), spanOf.call$1(node), spanOf.
call$1(this._scope.node)); | 3807 $globals.world.internalError(("scope mismatch. Trying to pop \"" + node + "\
" but found ") + (" \"" + this._scope.node + "\""), spanOf(node), spanOf(this._s
cope.node)); |
| 3817 } | 3808 } |
| 3818 this._scope = this._scope.parent; | 3809 this._scope = this._scope.parent; |
| 3819 } | 3810 } |
| 3820 MethodGenerator.prototype._visitLoop = function(node, visitBody) { | 3811 MethodGenerator.prototype._visitLoop = function(node, visitBody) { |
| 3821 if (this._scope.inferTypes) { | 3812 if (this._scope.inferTypes) { |
| 3822 this._loopFixedPoint(node, visitBody); | 3813 this._loopFixedPoint(node, visitBody); |
| 3823 } | 3814 } |
| 3824 else { | 3815 else { |
| 3825 this._pushBlock(node, true); | 3816 this._pushBlock(node, true); |
| 3826 visitBody.call$0(); | 3817 visitBody(); |
| 3827 this._popBlock(node); | 3818 this._popBlock(node); |
| 3828 } | 3819 } |
| 3829 } | 3820 } |
| 3830 MethodGenerator.prototype._loopFixedPoint = function(node, visitBody) { | 3821 MethodGenerator.prototype._loopFixedPoint = function(node, visitBody) { |
| 3831 var savedCounters = this.counters; | 3822 var savedCounters = this.counters; |
| 3832 var savedWriter = this.writer; | 3823 var savedWriter = this.writer; |
| 3833 var tries = (0); | 3824 var tries = (0); |
| 3834 var startScope = this._scope.snapshot(); | 3825 var startScope = this._scope.snapshot(); |
| 3835 var s = startScope; | 3826 var s = startScope; |
| 3836 while (true) { | 3827 while (true) { |
| 3837 this.writer = new CodeWriter(); | 3828 this.writer = new CodeWriter(); |
| 3838 this.counters = new CounterLog(); | 3829 this.counters = new CounterLog(); |
| 3839 this._pushBlock(node, true); | 3830 this._pushBlock(node, true); |
| 3840 if (tries++ >= $globals.options.maxInferenceIterations) { | 3831 if (tries++ >= $globals.options.maxInferenceIterations) { |
| 3841 this._scope.inferTypes = false; | 3832 this._scope.inferTypes = false; |
| 3842 } | 3833 } |
| 3843 visitBody.call$0(); | 3834 visitBody(); |
| 3844 this._popBlock(node); | 3835 this._popBlock(node); |
| 3845 if (!this._scope.inferTypes || !this._scope.unionWith(s)) { | 3836 if (!this._scope.inferTypes || !this._scope.unionWith(s)) { |
| 3846 break; | 3837 break; |
| 3847 } | 3838 } |
| 3848 s = this._scope.snapshot(); | 3839 s = this._scope.snapshot(); |
| 3849 } | 3840 } |
| 3850 savedWriter.write$1(this.writer.get$text()); | 3841 savedWriter.write$1(this.writer.get$text()); |
| 3851 this.writer = savedWriter; | 3842 this.writer = savedWriter; |
| 3852 savedCounters.add$1(this.counters); | 3843 savedCounters.add$1(this.counters); |
| 3853 this.counters = savedCounters; | 3844 this.counters = savedCounters; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3885 } | 3876 } |
| 3886 return this.visitValue(node); | 3877 return this.visitValue(node); |
| 3887 } | 3878 } |
| 3888 MethodGenerator.prototype.visitDietStatement = function(node) { | 3879 MethodGenerator.prototype.visitDietStatement = function(node) { |
| 3889 var parser = new Parser(node.span.file, false, false, false, node.span.start); | 3880 var parser = new Parser(node.span.file, false, false, false, node.span.start); |
| 3890 this.visitStatementsInBlock(parser.block$0()); | 3881 this.visitStatementsInBlock(parser.block$0()); |
| 3891 return false; | 3882 return false; |
| 3892 } | 3883 } |
| 3893 MethodGenerator.prototype.visitVariableDefinition = function(node) { | 3884 MethodGenerator.prototype.visitVariableDefinition = function(node) { |
| 3894 var isFinal = false; | 3885 var isFinal = false; |
| 3895 if (node.modifiers != null && $eq(node.modifiers[(0)].get$kind(), (99))) { | 3886 if (node.modifiers != null && $eq(node.modifiers.$index((0)).get$kind(), (99))
) { |
| 3896 isFinal = true; | 3887 isFinal = true; |
| 3897 } | 3888 } |
| 3898 this.writer.write("var "); | 3889 this.writer.write("var "); |
| 3899 var type = this.method.resolveType$2(node.type, false); | 3890 var type = this.method.resolveType$2(node.type, false); |
| 3900 for (var i = (0); | 3891 for (var i = (0); |
| 3901 i < node.names.get$length(); i++) { | 3892 i < node.names.get$length(); i++) { |
| 3902 if (i > (0)) { | 3893 if (i > (0)) { |
| 3903 this.writer.write(", "); | 3894 this.writer.write(", "); |
| 3904 } | 3895 } |
| 3905 var name = node.names[i].get$name(); | 3896 var name = node.names.$index(i).get$name(); |
| 3906 var value = this.visitValue(node.values[i]); | 3897 var value = this.visitValue(node.values.$index(i)); |
| 3907 if (isFinal && value == null) { | 3898 if (isFinal && value == null) { |
| 3908 $globals.world.error("no value specified for final variable", node.span); | 3899 $globals.world.error("no value specified for final variable", node.span); |
| 3909 } | 3900 } |
| 3910 var val = this._scope.create(name, type, node.names[i].get$span(), isFinal,
false); | 3901 var val = this._scope.create(name, type, node.names.$index(i).get$span(), is
Final, false); |
| 3911 if (value == null) { | 3902 if (value == null) { |
| 3912 if (this._scope.reentrant) { | 3903 if (this._scope.reentrant) { |
| 3913 this.writer.write(("" + val.get$code() + " = null")); | 3904 this.writer.write(("" + val.get$code() + " = null")); |
| 3914 } | 3905 } |
| 3915 else { | 3906 else { |
| 3916 this.writer.write(("" + val.get$code())); | 3907 this.writer.write(("" + val.get$code())); |
| 3917 } | 3908 } |
| 3918 } | 3909 } |
| 3919 else { | 3910 else { |
| 3920 value = value.convertTo$2(this, type); | 3911 value = value.convertTo$2(this, type); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4042 if (node.test != null) { | 4033 if (node.test != null) { |
| 4043 var test = $this.visitBool(node.test); | 4034 var test = $this.visitBool(node.test); |
| 4044 $this.writer.write((" " + test.get$code() + "; ")); | 4035 $this.writer.write((" " + test.get$code() + "; ")); |
| 4045 } | 4036 } |
| 4046 else { | 4037 else { |
| 4047 $this.writer.write("; "); | 4038 $this.writer.write("; "); |
| 4048 } | 4039 } |
| 4049 var needsComma = false; | 4040 var needsComma = false; |
| 4050 var $$list = node.step; | 4041 var $$list = node.step; |
| 4051 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4042 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4052 var s = $$list[$$i]; | 4043 var s = $$list.$index($$i); |
| 4053 if (needsComma) $this.writer.write(", "); | 4044 if (needsComma) $this.writer.write(", "); |
| 4054 var sv = $this.visitVoid(s); | 4045 var sv = $this.visitVoid(s); |
| 4055 $this.writer.write(sv.get$code()); | 4046 $this.writer.write(sv.get$code()); |
| 4056 needsComma = true; | 4047 needsComma = true; |
| 4057 } | 4048 } |
| 4058 $this.writer.write(") "); | 4049 $this.writer.write(") "); |
| 4059 $this._pushBlock(node.body, false); | 4050 $this._pushBlock(node.body, false); |
| 4060 node.body.visit($this); | 4051 node.body.visit($this); |
| 4061 $this._popBlock(node.body); | 4052 $this._popBlock(node.body); |
| 4062 }) | 4053 }) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4114 MethodGenerator.prototype._genStackTraceOf = function(trace, ex) { | 4105 MethodGenerator.prototype._genStackTraceOf = function(trace, ex) { |
| 4115 var result = this._invokeNative("_stackTraceOf", [ex]); | 4106 var result = this._invokeNative("_stackTraceOf", [ex]); |
| 4116 this.writer.writeln(("var " + trace.get$code() + " = " + result.get$code() + "
;")); | 4107 this.writer.writeln(("var " + trace.get$code() + " = " + result.get$code() + "
;")); |
| 4117 } | 4108 } |
| 4118 MethodGenerator.prototype.visitTryStatement = function(node) { | 4109 MethodGenerator.prototype.visitTryStatement = function(node) { |
| 4119 this.writer.enterBlock("try {"); | 4110 this.writer.enterBlock("try {"); |
| 4120 this._pushBlock(node.body, false); | 4111 this._pushBlock(node.body, false); |
| 4121 this.visitStatementsInBlock(node.body); | 4112 this.visitStatementsInBlock(node.body); |
| 4122 this._popBlock(node.body); | 4113 this._popBlock(node.body); |
| 4123 if (node.catches.get$length() == (1)) { | 4114 if (node.catches.get$length() == (1)) { |
| 4124 var catch_ = node.catches[(0)]; | 4115 var catch_ = node.catches.$index((0)); |
| 4125 this._pushBlock(catch_, false); | 4116 this._pushBlock(catch_, false); |
| 4126 var exType = this.method.resolveType$2(catch_.get$exception().get$type(), fa
lse); | 4117 var exType = this.method.resolveType$2(catch_.get$exception().get$type(), fa
lse); |
| 4127 var ex = this._scope.declare(catch_.get$exception()); | 4118 var ex = this._scope.declare(catch_.get$exception()); |
| 4128 this._scope.rethrow = ex.get$code(); | 4119 this._scope.rethrow = ex.get$code(); |
| 4129 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); | 4120 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); |
| 4130 if (catch_.get$trace() != null) { | 4121 if (catch_.get$trace() != null) { |
| 4131 var trace = this._scope.declare(catch_.get$trace()); | 4122 var trace = this._scope.declare(catch_.get$trace()); |
| 4132 this._genStackTraceOf(trace, ex); | 4123 this._genStackTraceOf(trace, ex); |
| 4133 } | 4124 } |
| 4134 this._genToDartException(ex); | 4125 this._genToDartException(ex); |
| 4135 if (!exType.get$isVarOrObject()) { | 4126 if (!exType.get$isVarOrObject()) { |
| 4136 var test = ex.instanceOf$3$isTrue$forceCheck(this, exType, catch_.get$exce
ption().get$span(), false, true); | 4127 var test = ex.instanceOf$3$isTrue$forceCheck(this, exType, catch_.get$exce
ption().get$span(), false, true); |
| 4137 this.writer.writeln(("if (" + test.get$code() + ") throw " + ex.get$code()
+ ";")); | 4128 this.writer.writeln(("if (" + test.get$code() + ") throw " + ex.get$code()
+ ";")); |
| 4138 } | 4129 } |
| 4139 this.visitStatementsInBlock(node.catches[(0)].get$body()); | 4130 this.visitStatementsInBlock(node.catches.$index((0)).get$body()); |
| 4140 this._popBlock(catch_); | 4131 this._popBlock(catch_); |
| 4141 } | 4132 } |
| 4142 else if (node.catches.get$length() > (0)) { | 4133 else if (node.catches.get$length() > (0)) { |
| 4143 this._pushBlock(node, false); | 4134 this._pushBlock(node, false); |
| 4144 var ex = this._scope.create("$ex", $globals.world.varType, null, false, fals
e); | 4135 var ex = this._scope.create("$ex", $globals.world.varType, null, false, fals
e); |
| 4145 this._scope.rethrow = ex.get$code(); | 4136 this._scope.rethrow = ex.get$code(); |
| 4146 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); | 4137 this.writer.nextBlock(("} catch (" + ex.get$code() + ") {")); |
| 4147 var trace = null; | 4138 var trace = null; |
| 4148 if (node.catches.some((function (c) { | 4139 if (node.catches.some((function (c) { |
| 4149 return c.get$trace() != null; | 4140 return c.get$trace() != null; |
| 4150 }) | 4141 }) |
| 4151 )) { | 4142 )) { |
| 4152 trace = this._scope.create("$trace", $globals.world.varType, null, false,
false); | 4143 trace = this._scope.create("$trace", $globals.world.varType, null, false,
false); |
| 4153 this._genStackTraceOf(trace, ex); | 4144 this._genStackTraceOf(trace, ex); |
| 4154 } | 4145 } |
| 4155 this._genToDartException(ex); | 4146 this._genToDartException(ex); |
| 4156 var needsRethrow = true; | 4147 var needsRethrow = true; |
| 4157 for (var i = (0); | 4148 for (var i = (0); |
| 4158 i < node.catches.get$length(); i++) { | 4149 i < node.catches.get$length(); i++) { |
| 4159 var catch_ = node.catches[i]; | 4150 var catch_ = node.catches.$index(i); |
| 4160 this._pushBlock(catch_, false); | 4151 this._pushBlock(catch_, false); |
| 4161 var tmpType = this.method.resolveType$2(catch_.get$exception().get$type(),
false); | 4152 var tmpType = this.method.resolveType$2(catch_.get$exception().get$type(),
false); |
| 4162 var tmp = this._scope.declare(catch_.get$exception()); | 4153 var tmp = this._scope.declare(catch_.get$exception()); |
| 4163 if (!tmpType.get$isVarOrObject()) { | 4154 if (!tmpType.get$isVarOrObject()) { |
| 4164 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmpType, catch_.get$e
xception().get$span(), true, true); | 4155 var test = ex.instanceOf$3$isTrue$forceCheck(this, tmpType, catch_.get$e
xception().get$span(), true, true); |
| 4165 if (i == (0)) { | 4156 if (i == (0)) { |
| 4166 this.writer.enterBlock(("if (" + test.get$code() + ") {")); | 4157 this.writer.enterBlock(("if (" + test.get$code() + ") {")); |
| 4167 } | 4158 } |
| 4168 else { | 4159 else { |
| 4169 this.writer.nextBlock(("} else if (" + test.get$code() + ") {")); | 4160 this.writer.nextBlock(("} else if (" + test.get$code() + ") {")); |
| 4170 } | 4161 } |
| 4171 } | 4162 } |
| 4172 else if (i > (0)) { | 4163 else if (i > (0)) { |
| 4173 this.writer.nextBlock("} else {"); | 4164 this.writer.nextBlock("} else {"); |
| 4174 } | 4165 } |
| 4175 this.writer.writeln(("var " + tmp.get$code() + " = " + ex.get$code() + ";"
)); | 4166 this.writer.writeln(("var " + tmp.get$code() + " = " + ex.get$code() + ";"
)); |
| 4176 if (catch_.get$trace() != null) { | 4167 if (catch_.get$trace() != null) { |
| 4177 var tmptrace = this._scope.declare(catch_.get$trace()); | 4168 var tmptrace = this._scope.declare(catch_.get$trace()); |
| 4178 this.writer.writeln(("var " + tmptrace.get$code() + " = " + trace.get$co
de() + ";")); | 4169 this.writer.writeln(("var " + tmptrace.get$code() + " = " + trace.get$co
de() + ";")); |
| 4179 } | 4170 } |
| 4180 this.visitStatementsInBlock(catch_.get$body()); | 4171 this.visitStatementsInBlock(catch_.get$body()); |
| 4181 this._popBlock(catch_); | 4172 this._popBlock(catch_); |
| 4182 if (tmpType.get$isVarOrObject()) { | 4173 if (tmpType.get$isVarOrObject()) { |
| 4183 if ($add(i, (1)) < node.catches.get$length()) { | 4174 if (i + (1) < node.catches.get$length()) { |
| 4184 $globals.world.error("Unreachable catch clause", node.catches[$add(i,
(1))].get$span()); | 4175 $globals.world.error("Unreachable catch clause", node.catches.$index(i
+ (1)).get$span()); |
| 4185 } | 4176 } |
| 4186 if (i > (0)) { | 4177 if (i > (0)) { |
| 4187 this.writer.exitBlock("}"); | 4178 this.writer.exitBlock("}"); |
| 4188 } | 4179 } |
| 4189 needsRethrow = false; | 4180 needsRethrow = false; |
| 4190 break; | 4181 break; |
| 4191 } | 4182 } |
| 4192 } | 4183 } |
| 4193 if (needsRethrow) { | 4184 if (needsRethrow) { |
| 4194 this.writer.nextBlock("} else {"); | 4185 this.writer.nextBlock("} else {"); |
| 4195 this.writer.writeln(("throw " + ex.get$code() + ";")); | 4186 this.writer.writeln(("throw " + ex.get$code() + ";")); |
| 4196 this.writer.exitBlock("}"); | 4187 this.writer.exitBlock("}"); |
| 4197 } | 4188 } |
| 4198 this._popBlock(node); | 4189 this._popBlock(node); |
| 4199 } | 4190 } |
| 4200 if (node.finallyBlock != null) { | 4191 if (node.finallyBlock != null) { |
| 4201 this.writer.nextBlock("} finally {"); | 4192 this.writer.nextBlock("} finally {"); |
| 4202 this._pushBlock(node.finallyBlock, false); | 4193 this._pushBlock(node.finallyBlock, false); |
| 4203 this.visitStatementsInBlock(node.finallyBlock); | 4194 this.visitStatementsInBlock(node.finallyBlock); |
| 4204 this._popBlock(node.finallyBlock); | 4195 this._popBlock(node.finallyBlock); |
| 4205 } | 4196 } |
| 4206 this.writer.exitBlock("}"); | 4197 this.writer.exitBlock("}"); |
| 4207 return false; | 4198 return false; |
| 4208 } | 4199 } |
| 4209 MethodGenerator.prototype.visitSwitchStatement = function(node) { | 4200 MethodGenerator.prototype.visitSwitchStatement = function(node) { |
| 4210 var test = this.visitValue(node.test); | 4201 var test = this.visitValue(node.test); |
| 4211 this.writer.enterBlock(("switch (" + test.get$code() + ") {")); | 4202 this.writer.enterBlock(("switch (" + test.get$code() + ") {")); |
| 4212 var $$list = node.cases; | 4203 var $$list = node.cases; |
| 4213 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4204 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4214 var case_ = $$list[$$i]; | 4205 var case_ = $$list.$index($$i); |
| 4215 if (case_.get$label() != null) { | 4206 if (case_.get$label() != null) { |
| 4216 $globals.world.error("unimplemented: labeled case statement", case_.get$sp
an()); | 4207 $globals.world.error("unimplemented: labeled case statement", case_.get$sp
an()); |
| 4217 } | 4208 } |
| 4218 this._pushBlock(case_, false); | 4209 this._pushBlock(case_, false); |
| 4219 for (var i = (0); | 4210 for (var i = (0); |
| 4220 i < case_.get$cases().get$length(); i++) { | 4211 i < case_.get$cases().get$length(); i++) { |
| 4221 var expr = case_.get$cases().$index(i); | 4212 var expr = case_.get$cases().$index(i); |
| 4222 if (expr == null) { | 4213 if (expr == null) { |
| 4223 if (i < case_.get$cases().get$length() - (1)) { | 4214 if (i < case_.get$cases().get$length() - (1)) { |
| 4224 $globals.world.error("default clause must be the last case", case_.get
$span()); | 4215 $globals.world.error("default clause must be the last case", case_.get
$span()); |
| 4225 } | 4216 } |
| 4226 this.writer.writeln("default:"); | 4217 this.writer.writeln("default:"); |
| 4227 } | 4218 } |
| 4228 else { | 4219 else { |
| 4229 var value = this.visitValue(expr); | 4220 var value = this.visitValue(expr); |
| 4230 this.writer.writeln(("case " + value.get$code() + ":")); | 4221 this.writer.writeln(("case " + value.get$code() + ":")); |
| 4231 } | 4222 } |
| 4232 } | 4223 } |
| 4233 this.writer.enterBlock(""); | 4224 this.writer.enterBlock(""); |
| 4234 var caseExits = this._visitAllStatements(case_.get$statements(), false); | 4225 var caseExits = this._visitAllStatements(case_.get$statements(), false); |
| 4235 if ($ne(case_, node.cases[node.cases.get$length() - (1)]) && !caseExits) { | 4226 if ($ne(case_, node.cases.$index(node.cases.get$length() - (1))) && !caseExi
ts) { |
| 4236 var span = case_.get$statements().$index(case_.get$statements().get$length
() - (1)).get$span(); | 4227 var span = case_.get$statements().$index(case_.get$statements().get$length
() - (1)).get$span(); |
| 4237 this.writer.writeln("$throw(new FallThroughError());"); | 4228 this.writer.writeln("$throw(new FallThroughError());"); |
| 4238 $globals.world.gen.corejs.useThrow = true; | 4229 $globals.world.gen.corejs.useThrow = true; |
| 4239 } | 4230 } |
| 4240 this.writer.exitBlock(""); | 4231 this.writer.exitBlock(""); |
| 4241 this._popBlock(case_); | 4232 this._popBlock(case_); |
| 4242 } | 4233 } |
| 4243 this.writer.exitBlock("}"); | 4234 this.writer.exitBlock("}"); |
| 4244 return false; | 4235 return false; |
| 4245 } | 4236 } |
| 4246 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) { | 4237 MethodGenerator.prototype._visitAllStatements = function(statementList, exits) { |
| 4247 for (var i = (0); | 4238 for (var i = (0); |
| 4248 i < statementList.get$length(); i++) { | 4239 i < statementList.get$length(); i++) { |
| 4249 var stmt = statementList.$index(i); | 4240 var stmt = statementList.$index(i); |
| 4250 exits = stmt.visit$1(this); | 4241 exits = stmt.visit$1(this); |
| 4251 if ($ne(stmt, statementList.$index(statementList.get$length() - (1))) && exi
ts) { | 4242 if ($ne(stmt, statementList.$index(statementList.get$length() - (1))) && exi
ts) { |
| 4252 $globals.world.warning("unreachable code", statementList.$index($add(i, (1
))).get$span()); | 4243 $globals.world.warning("unreachable code", statementList.$index(i + (1)).g
et$span()); |
| 4253 } | 4244 } |
| 4254 } | 4245 } |
| 4255 return exits; | 4246 return exits; |
| 4256 } | 4247 } |
| 4257 MethodGenerator.prototype.visitBlockStatement = function(node) { | 4248 MethodGenerator.prototype.visitBlockStatement = function(node) { |
| 4258 this._pushBlock(node, false); | 4249 this._pushBlock(node, false); |
| 4259 this.writer.enterBlock("{"); | 4250 this.writer.enterBlock("{"); |
| 4260 var exits = this._visitAllStatements(node.body, false); | 4251 var exits = this._visitAllStatements(node.body, false); |
| 4261 this.writer.exitBlock("}"); | 4252 this.writer.exitBlock("}"); |
| 4262 this._popBlock(node); | 4253 this._popBlock(node); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4378 var y = this.visitValue(node.y); | 4369 var y = this.visitValue(node.y); |
| 4379 return x.binop$4(kind, y, this, node); | 4370 return x.binop$4(kind, y, this, node); |
| 4380 } | 4371 } |
| 4381 var assignKind = TokenKind.kindFromAssign(node.op.kind); | 4372 var assignKind = TokenKind.kindFromAssign(node.op.kind); |
| 4382 if ($eq(assignKind, (-1))) { | 4373 if ($eq(assignKind, (-1))) { |
| 4383 var x = this.visitValue(node.x); | 4374 var x = this.visitValue(node.x); |
| 4384 var y = this.visitValue(node.y); | 4375 var y = this.visitValue(node.y); |
| 4385 return x.binop$4(kind, y, this, node); | 4376 return x.binop$4(kind, y, this, node); |
| 4386 } | 4377 } |
| 4387 else if (($ne(assignKind, (0))) && this._expressionNeedsParens(node.y)) { | 4378 else if (($ne(assignKind, (0))) && this._expressionNeedsParens(node.y)) { |
| 4388 return this._visitAssign(assignKind, node.x, new ParenExpression(node.y, nod
e.y.span), node, isVoid ? (1) : (2)); | 4379 return this._visitAssign(assignKind, node.x, new ParenExpression(node.y, nod
e.y.span), node, to$call$1(null), isVoid); |
| 4389 } | 4380 } |
| 4390 else { | 4381 else { |
| 4391 return this._visitAssign(assignKind, node.x, node.y, node, isVoid ? (1) : (2
)); | 4382 return this._visitAssign(assignKind, node.x, node.y, node, to$call$1(null),
isVoid); |
| 4392 } | 4383 } |
| 4393 } | 4384 } |
| 4394 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, return
Kind) { | 4385 MethodGenerator.prototype._visitAssign = function(kind, xn, yn, position, captur
eOriginal, isVoid) { |
| 4386 if (captureOriginal == null) { |
| 4387 captureOriginal = (function (x) { |
| 4388 return x; |
| 4389 }) |
| 4390 ; |
| 4391 } |
| 4395 if ((xn instanceof VarExpression)) { | 4392 if ((xn instanceof VarExpression)) { |
| 4396 return this._visitVarAssign(kind, xn, yn, position, returnKind); | 4393 return this._visitVarAssign(kind, xn, yn, position, captureOriginal); |
| 4397 } | 4394 } |
| 4398 else if ((xn instanceof IndexExpression)) { | 4395 else if ((xn instanceof IndexExpression)) { |
| 4399 return this._visitIndexAssign(kind, xn, yn, position, returnKind); | 4396 return this._visitIndexAssign(kind, xn, yn, position, captureOriginal, isVoi
d); |
| 4400 } | 4397 } |
| 4401 else if ((xn instanceof DotExpression)) { | 4398 else if ((xn instanceof DotExpression)) { |
| 4402 return this._visitDotAssign(kind, xn, yn, position, returnKind); | 4399 return this._visitDotAssign(kind, xn, yn, position, captureOriginal); |
| 4403 } | 4400 } |
| 4404 else { | 4401 else { |
| 4405 $globals.world.error("illegal lhs", xn.span); | 4402 $globals.world.error("illegal lhs", xn.span); |
| 4406 } | 4403 } |
| 4407 } | 4404 } |
| 4408 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, ret
urnKind) { | 4405 MethodGenerator.prototype._visitVarAssign = function(kind, xn, yn, position, cap
tureOriginal) { |
| 4409 var name = xn.name.name; | 4406 var name = xn.name.name; |
| 4410 var x = this._scope.lookup(name); | 4407 var x = this._scope.lookup(name); |
| 4411 var y = this.visitValue(yn); | 4408 var y = this.visitValue(yn); |
| 4412 if (x != null) { | 4409 if (x != null) { |
| 4413 y = y.convertTo$2(this, x.get$staticType()); | 4410 y = y.convertTo$2(this, x.get$staticType()); |
| 4414 this._scope.inferAssign(name, Value.union(x, y)); | 4411 this._scope.inferAssign(name, Value.union(x, y)); |
| 4415 if (x.get$isFinal()) { | 4412 } |
| 4416 $globals.world.error(("final variable \"" + x.get$code() + "\" is not assi
gnable"), position.span); | 4413 else { |
| 4417 } | 4414 var members = this.method.declaringType.resolveMember(name); |
| 4418 if (kind == (0)) { | 4415 x = this._makeThisOrType(position.span); |
| 4419 return new Value(y.get$type(), ("" + x.get$code() + " = " + y.get$code()),
position.span); | 4416 if (members != null) { |
| 4420 } | 4417 if ($globals.options.forceDynamic && !members.get$isStatic()) { |
| 4421 else if (x.get$type().get$isNum() && y.get$type().get$isNum() && (kind != (4
6))) { | 4418 members = this.findMembers(xn.name.name); |
| 4422 if (returnKind == (3)) { | |
| 4423 $globals.world.internalError("should not be here", position.span); | |
| 4424 } | 4419 } |
| 4425 var op = TokenKind.kindToString(kind); | 4420 if (kind == (0)) { |
| 4426 return new Value(y.get$type(), ("" + x.get$code() + " " + op + "= " + y.ge
t$code()), position.span); | 4421 return x.set_$4(this, name, position, y); |
| 4422 } |
| 4423 else if (!members.get$treatAsField() || members.get$containsMethods()) { |
| 4424 var right = x.get_$3(this, name, position); |
| 4425 right = captureOriginal(right); |
| 4426 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new
Arguments(null, [y])); |
| 4427 return x.set_$4(this, name, position, y); |
| 4428 } |
| 4429 else { |
| 4430 x = x.get_$3(this, name, position); |
| 4431 } |
| 4427 } | 4432 } |
| 4428 else { | 4433 else { |
| 4429 var right = x; | 4434 var member = this.get$library().lookup(name, xn.name.span); |
| 4430 y = right.binop$4(kind, y, this, position); | 4435 if (member == null) { |
| 4431 if (returnKind == (3)) { | 4436 $globals.world.warning(("can not resolve " + name), xn.span); |
| 4432 var tmp = this.forceTemp(x); | 4437 return this._makeMissingValue(name); |
| 4433 var ret = new Value(x.get$type(), ("(" + tmp.get$code() + " = " + x.get$
code() + ", " + x.get$code() + " = " + y.get$code() + ", " + tmp.get$code() + ")
"), position.span); | 4438 } |
| 4434 this.freeTemp(tmp); | 4439 members = new MemberSet(member, false); |
| 4435 return ret; | 4440 if (!members.get$treatAsField() || members.get$containsMethods()) { |
| 4441 if (kind != (0)) { |
| 4442 var right = members._get$3(this, position, x); |
| 4443 right = captureOriginal(right); |
| 4444 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, n
ew Arguments(null, [y])); |
| 4445 } |
| 4446 return members._set$4(this, position, x, y); |
| 4436 } | 4447 } |
| 4437 else { | 4448 else { |
| 4438 return new Value(x.get$type(), ("" + x.get$code() + " = " + y.get$code()
), position.span); | 4449 x = members._get$3(this, position, x); |
| 4439 } | 4450 } |
| 4440 } | 4451 } |
| 4452 y = y.convertTo$2(this, x.get$staticType()); |
| 4453 } |
| 4454 if (x.get$isFinal()) { |
| 4455 $globals.world.error(("final variable \"" + x.get$code() + "\" is not assign
able"), position.span); |
| 4456 } |
| 4457 if (kind == (0)) { |
| 4458 x = captureOriginal(x); |
| 4459 return new Value(y.get$type(), ("" + x.get$code() + " = " + y.get$code()), p
osition.span); |
| 4460 } |
| 4461 else if (x.get$type().get$isNum() && y.get$type().get$isNum() && (kind != (46)
)) { |
| 4462 x = captureOriginal(x); |
| 4463 var op = TokenKind.kindToString(kind); |
| 4464 return new Value(y.get$type(), ("" + x.get$code() + " " + op + "= " + y.get$
code()), position.span); |
| 4441 } | 4465 } |
| 4442 else { | 4466 else { |
| 4443 x = this._makeThisOrType(position.span); | 4467 var right = x; |
| 4444 return x.set_$4$kind$returnKind(this, name, position, y, kind, returnKind); | 4468 right = captureOriginal(right); |
| 4469 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg
uments(null, [y])); |
| 4470 return new Value(y.get$type(), ("" + x.get$code() + " = " + y.get$code()), p
osition.span); |
| 4445 } | 4471 } |
| 4446 } | 4472 } |
| 4447 MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, r
eturnKind) { | 4473 MethodGenerator.prototype._visitIndexAssign = function(kind, xn, yn, position, c
aptureOriginal, isVoid) { |
| 4448 var target = this.visitValue(xn.target); | 4474 var target = this.visitValue(xn.target); |
| 4475 var tmptarget = target; |
| 4476 if (kind != (0)) tmptarget = this.getTemp(target); |
| 4449 var index = this.visitValue(xn.index); | 4477 var index = this.visitValue(xn.index); |
| 4478 var tmpindex = index; |
| 4479 if (kind != (0)) tmpindex = this.getTemp(index); |
| 4450 var y = this.visitValue(yn); | 4480 var y = this.visitValue(yn); |
| 4451 return target.setIndex$4$kind$returnKind(this, index, position, y, kind, retur
nKind); | 4481 if (kind != (0)) { |
| 4482 index = this.assignTemp(tmpindex, index); |
| 4483 var right = tmptarget.invoke$4(this, ":index", position, new Arguments(null,
[tmpindex])); |
| 4484 right = captureOriginal(right); |
| 4485 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg
uments(null, [y])); |
| 4486 } |
| 4487 var tmpy = null; |
| 4488 if (!isVoid) { |
| 4489 tmpy = this.getTemp(y); |
| 4490 y = this.assignTemp(tmpy, y); |
| 4491 } |
| 4492 var ret = this.assignTemp(tmptarget, target).invoke(this, ":setindex", positio
n, new Arguments(null, [index, y]), false); |
| 4493 if (tmpy != null) { |
| 4494 ret = new Value(ret.get$type(), ("(" + ret.get$code() + ", " + tmpy.get$code
() + ")"), ret.get$span()); |
| 4495 if ($ne(tmpy, y)) this.freeTemp(tmpy); |
| 4496 } |
| 4497 if ($ne(tmptarget, target)) this.freeTemp(tmptarget); |
| 4498 if ($ne(tmpindex, index)) this.freeTemp(tmpindex); |
| 4499 return ret; |
| 4452 } | 4500 } |
| 4453 MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, ret
urnKind) { | 4501 MethodGenerator.prototype._visitDotAssign = function(kind, xn, yn, position, cap
tureOriginal) { |
| 4454 var target = xn.self.visit(this); | 4502 var target = xn.self.visit(this); |
| 4455 var y = this.visitValue(yn); | 4503 var y = this.visitValue(yn); |
| 4456 return target.set_$4$kind$returnKind(this, xn.name.name, xn.name, y, kind, ret
urnKind); | 4504 var tmptarget = target; |
| 4505 if (kind != (0)) { |
| 4506 tmptarget = this.getTemp(target); |
| 4507 var right = tmptarget.get_$3(this, xn.name.name, xn.name); |
| 4508 right = captureOriginal(right); |
| 4509 y = right.invoke$4(this, TokenKind.binaryMethodName(kind), position, new Arg
uments(null, [y])); |
| 4510 } |
| 4511 var ret = this.assignTemp(tmptarget, target).set_(this, xn.name.name, xn.name,
y, false); |
| 4512 if ($ne(tmptarget, target)) this.freeTemp(tmptarget); |
| 4513 return ret; |
| 4457 } | 4514 } |
| 4458 MethodGenerator.prototype.visitUnaryExpression = function(node) { | 4515 MethodGenerator.prototype.visitUnaryExpression = function(node) { |
| 4459 var value = this.visitValue(node.self); | 4516 var value = this.visitValue(node.self); |
| 4460 switch (node.op.kind) { | 4517 switch (node.op.kind) { |
| 4461 case (16): | 4518 case (16): |
| 4462 case (17): | 4519 case (17): |
| 4463 | 4520 |
| 4464 if (value.get$type().get$isNum()) { | 4521 if (value.get$type().get$isNum()) { |
| 4465 return new Value(value.get$type(), ("" + node.op + value.get$code()), no
de.span); | 4522 return new Value(value.get$type(), ("" + node.op + value.get$code()), no
de.span); |
| 4466 } | 4523 } |
| 4467 else { | 4524 else { |
| 4468 var kind = ((16) == node.op.kind ? (42) : (43)); | 4525 var kind = ((16) == node.op.kind ? (42) : (43)); |
| 4469 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.
span); | 4526 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.
span); |
| 4470 var assignValue = this._visitAssign(kind, node.self, operand, node, (2))
; | 4527 var assignValue = this._visitAssign(kind, node.self, operand, node, to$c
all$1(null), false); |
| 4471 return new Value(assignValue.get$type(), ("(" + assignValue.get$code() +
")"), node.span); | 4528 return new Value(assignValue.get$type(), ("(" + assignValue.get$code() +
")"), node.span); |
| 4472 } | 4529 } |
| 4473 | 4530 |
| 4474 } | 4531 } |
| 4475 return value.unop$3(node.op.kind, this, node); | 4532 return value.unop$3(node.op.kind, this, node); |
| 4476 } | 4533 } |
| 4477 MethodGenerator.prototype.visitDeclaredIdentifier = function(node) { | 4534 MethodGenerator.prototype.visitDeclaredIdentifier = function(node) { |
| 4478 $globals.world.error("Expected expression", node.span); | 4535 $globals.world.error("Expected expression", node.span); |
| 4479 } | 4536 } |
| 4480 MethodGenerator.prototype.visitAwaitExpression = function(node) { | 4537 MethodGenerator.prototype.visitAwaitExpression = function(node) { |
| 4481 $globals.world.internalError("Await expressions should have been eliminated be
fore code generation", node.span); | 4538 $globals.world.internalError("Await expressions should have been eliminated be
fore code generation", node.span); |
| 4482 } | 4539 } |
| 4483 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { | 4540 MethodGenerator.prototype.visitPostfixExpression = function(node, isVoid) { |
| 4541 var $this = this; // closure support |
| 4484 var value = this.visitValue(node.body); | 4542 var value = this.visitValue(node.body); |
| 4485 if (value.get$type().get$isNum() && !value.get$isFinal()) { | 4543 if (value.get$type().get$isNum() && !value.get$isFinal()) { |
| 4486 return new Value(value.get$type(), ("" + value.get$code() + node.op), node.s
pan); | 4544 return new Value(value.get$type(), ("" + value.get$code() + node.op), node.s
pan); |
| 4487 } | 4545 } |
| 4488 var kind = ((16) == node.op.kind) ? (42) : (43); | 4546 var kind = ((16) == node.op.kind) ? (42) : (43); |
| 4489 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.span); | 4547 var operand = new LiteralExpression(Value.fromInt((1), node.span), node.span); |
| 4490 var ret = this._visitAssign(kind, node.body, operand, node, isVoid ? (1) : (3)
); | 4548 var tmpleft = null, left = null; |
| 4549 var ret = this._visitAssign(kind, node.body, operand, node, (function (l) { |
| 4550 if (isVoid) { |
| 4551 return l; |
| 4552 } |
| 4553 else { |
| 4554 left = l; |
| 4555 tmpleft = $this.forceTemp(l); |
| 4556 return $this.assignTemp(tmpleft, left); |
| 4557 } |
| 4558 }) |
| 4559 , false); |
| 4560 if (tmpleft != null) { |
| 4561 ret = new Value(ret.get$type(), ("(" + ret.get$code() + ", " + tmpleft.get$c
ode() + ")"), node.span); |
| 4562 } |
| 4563 if ($ne(tmpleft, left)) { |
| 4564 this.freeTemp(tmpleft); |
| 4565 } |
| 4491 return ret; | 4566 return ret; |
| 4492 } | 4567 } |
| 4493 MethodGenerator.prototype.visitNewExpression = function(node) { | 4568 MethodGenerator.prototype.visitNewExpression = function(node) { |
| 4494 var typeRef = node.type; | 4569 var typeRef = node.type; |
| 4495 var constructorName = ""; | 4570 var constructorName = ""; |
| 4496 if (node.name != null) { | 4571 if (node.name != null) { |
| 4497 constructorName = node.name.name; | 4572 constructorName = node.name.name; |
| 4498 } | 4573 } |
| 4499 if ($eq(constructorName, "") && !(typeRef instanceof GenericTypeReference) &&
typeRef.get$names() != null) { | 4574 if ($eq(constructorName, "") && !(typeRef instanceof GenericTypeReference) &&
typeRef.get$names() != null) { |
| 4500 var names = ListFactory.ListFactory$from$factory(typeRef.get$names()); | 4575 var names = ListFactory.ListFactory$from$factory(typeRef.get$names()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4519 } | 4594 } |
| 4520 $globals.world.error(("no matching constructor for " + name), node.span); | 4595 $globals.world.error(("no matching constructor for " + name), node.span); |
| 4521 return this._makeMissingValue(name); | 4596 return this._makeMissingValue(name); |
| 4522 } | 4597 } |
| 4523 if (node.isConst) { | 4598 if (node.isConst) { |
| 4524 if (!m.get$isConst()) { | 4599 if (!m.get$isConst()) { |
| 4525 $globals.world.error("can't use const on a non-const constructor", node.sp
an); | 4600 $globals.world.error("can't use const on a non-const constructor", node.sp
an); |
| 4526 } | 4601 } |
| 4527 var $$list = node.arguments; | 4602 var $$list = node.arguments; |
| 4528 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4603 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4529 var arg = $$list[$$i]; | 4604 var arg = $$list.$index($$i); |
| 4530 if (!this.visitValue(arg.get$value()).get$isConst()) { | 4605 if (!this.visitValue(arg.get$value()).get$isConst()) { |
| 4531 $globals.world.error("const constructor expects const arguments", arg.ge
t$span()); | 4606 $globals.world.error("const constructor expects const arguments", arg.ge
t$span()); |
| 4532 } | 4607 } |
| 4533 } | 4608 } |
| 4534 } | 4609 } |
| 4535 var target = new TypeValue(type, typeRef.get$span()); | 4610 var target = new TypeValue(type, typeRef.get$span()); |
| 4536 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); | 4611 return m.invoke$4(this, node, target, this._makeArgs(node.arguments)); |
| 4537 } | 4612 } |
| 4538 MethodGenerator.prototype.visitListExpression = function(node) { | 4613 MethodGenerator.prototype.visitListExpression = function(node) { |
| 4539 var argValues = []; | 4614 var argValues = []; |
| 4540 var listType = $globals.world.listType; | 4615 var listType = $globals.world.listType; |
| 4541 var type = $globals.world.varType; | 4616 var type = $globals.world.varType; |
| 4542 if (node.itemType != null) { | 4617 if (node.itemType != null) { |
| 4543 type = this.method.resolveType$2(node.itemType, true); | 4618 type = this.method.resolveType$2(node.itemType, true); |
| 4544 if (node.isConst && ((type instanceof ParameterType) || type.get$hasTypePara
ms())) { | 4619 if (node.isConst && ((type instanceof ParameterType) || type.get$hasTypePara
ms())) { |
| 4545 $globals.world.error("type parameter cannot be used in const list literals
"); | 4620 $globals.world.error("type parameter cannot be used in const list literals
"); |
| 4546 } | 4621 } |
| 4547 listType = listType.getOrMakeConcreteType$1([type]); | 4622 listType = listType.getOrMakeConcreteType$1([type]); |
| 4548 } | 4623 } |
| 4549 var $$list = node.values; | 4624 var $$list = node.values; |
| 4550 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4625 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4551 var item = $$list[$$i]; | 4626 var item = $$list.$index($$i); |
| 4552 var arg = this.visitTypedValue(item, type); | 4627 var arg = this.visitTypedValue(item, type); |
| 4553 argValues.add$1(arg); | 4628 argValues.add$1(arg); |
| 4554 if (node.isConst && !arg.get$isConst()) { | 4629 if (node.isConst && !arg.get$isConst()) { |
| 4555 $globals.world.error("const list can only contain const values", arg.get$s
pan()); | 4630 $globals.world.error("const list can only contain const values", arg.get$s
pan()); |
| 4556 } | 4631 } |
| 4557 } | 4632 } |
| 4558 $globals.world.listFactoryType.markUsed(); | 4633 $globals.world.listFactoryType.markUsed(); |
| 4559 var ret = new ListValue(argValues, node.isConst, listType, node.span); | 4634 var ret = new ListValue(argValues, node.isConst, listType, node.span); |
| 4560 if (ret.get$isConst()) return ret.getGlobalValue$0(); | 4635 if (ret.get$isConst()) return ret.getGlobalValue$0(); |
| 4561 return ret; | 4636 return ret; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 4578 } | 4653 } |
| 4579 } | 4654 } |
| 4580 valueType = this.method.resolveType$2(node.valueType, true); | 4655 valueType = this.method.resolveType$2(node.valueType, true); |
| 4581 if (node.isConst && ((valueType instanceof ParameterType) || valueType.get$h
asTypeParams())) { | 4656 if (node.isConst && ((valueType instanceof ParameterType) || valueType.get$h
asTypeParams())) { |
| 4582 $globals.world.error("type parameter cannot be used in const map literals"
); | 4657 $globals.world.error("type parameter cannot be used in const map literals"
); |
| 4583 } | 4658 } |
| 4584 mapType = mapType.getOrMakeConcreteType$1([keyType, valueType]); | 4659 mapType = mapType.getOrMakeConcreteType$1([keyType, valueType]); |
| 4585 } | 4660 } |
| 4586 for (var i = (0); | 4661 for (var i = (0); |
| 4587 i < node.items.get$length(); i += (2)) { | 4662 i < node.items.get$length(); i += (2)) { |
| 4588 var key = this.visitTypedValue(node.items[i], keyType); | 4663 var key = this.visitTypedValue(node.items.$index(i), keyType); |
| 4589 if (node.isConst && !key.get$isConst()) { | 4664 if (node.isConst && !key.get$isConst()) { |
| 4590 $globals.world.error("const map can only contain const keys", key.get$span
()); | 4665 $globals.world.error("const map can only contain const keys", key.get$span
()); |
| 4591 } | 4666 } |
| 4592 values.add$1(key); | 4667 values.add$1(key); |
| 4593 var value = this.visitTypedValue(node.items[$add(i, (1))], valueType); | 4668 var value = this.visitTypedValue(node.items.$index(i + (1)), valueType); |
| 4594 if (node.isConst && !value.get$isConst()) { | 4669 if (node.isConst && !value.get$isConst()) { |
| 4595 $globals.world.error("const map can only contain const values", value.get$
span()); | 4670 $globals.world.error("const map can only contain const values", value.get$
span()); |
| 4596 } | 4671 } |
| 4597 values.add$1(value); | 4672 values.add$1(value); |
| 4598 } | 4673 } |
| 4599 var ret = new MapValue(values, node.isConst, mapType, node.span); | 4674 var ret = new MapValue(values, node.isConst, mapType, node.span); |
| 4600 if (ret.get$isConst()) return ret.getGlobalValue$0(); | 4675 if (ret.get$isConst()) return ret.getGlobalValue$0(); |
| 4601 return ret; | 4676 return ret; |
| 4602 } | 4677 } |
| 4603 MethodGenerator.prototype.visitConditionalExpression = function(node) { | 4678 MethodGenerator.prototype.visitConditionalExpression = function(node) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4647 return u.op.kind == (16) || u.op.kind == (17); | 4722 return u.op.kind == (16) || u.op.kind == (17); |
| 4648 } | 4723 } |
| 4649 else { | 4724 else { |
| 4650 return false; | 4725 return false; |
| 4651 } | 4726 } |
| 4652 } | 4727 } |
| 4653 MethodGenerator.prototype.visitStringInterpExpression = function(node) { | 4728 MethodGenerator.prototype.visitStringInterpExpression = function(node) { |
| 4654 var items = []; | 4729 var items = []; |
| 4655 var $$list = node.pieces; | 4730 var $$list = node.pieces; |
| 4656 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 4731 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 4657 var item = $$list[$$i]; | 4732 var item = $$list.$index($$i); |
| 4658 var val = this.visitValue(item); | 4733 var val = this.visitValue(item); |
| 4659 val.invoke$4(this, "toString", item, Arguments.get$EMPTY()); | 4734 val.invoke$4(this, "toString", item, Arguments.get$EMPTY()); |
| 4660 var code = val.get$code(); | 4735 var code = val.get$code(); |
| 4661 if (this._expressionNeedsParens(item)) { | 4736 if (this._expressionNeedsParens(item)) { |
| 4662 code = ("(" + code + ")"); | 4737 code = ("(" + code + ")"); |
| 4663 } | 4738 } |
| 4664 if ($eq(items.get$length(), (0)) || ($ne(code, "''") && $ne(code, "\"\"")))
{ | 4739 if ($eq(items.get$length(), (0)) || ($ne(code, "''") && $ne(code, "\"\"")))
{ |
| 4665 items.add$1(code); | 4740 items.add$1(code); |
| 4666 } | 4741 } |
| 4667 } | 4742 } |
| 4668 return new Value($globals.world.stringType, ("(" + Strings.join(items, " + ")
+ ")"), node.span); | 4743 return new Value($globals.world.stringType, ("(" + Strings.join(items, " + ")
+ ")"), node.span); |
| 4669 } | 4744 } |
| 4670 MethodGenerator.prototype._checkNonStatic$1 = MethodGenerator.prototype._checkNo
nStatic; | 4745 MethodGenerator.prototype._checkNonStatic$1 = MethodGenerator.prototype._checkNo
nStatic; |
| 4671 MethodGenerator.prototype._pushBlock$1 = function($0) { | 4746 MethodGenerator.prototype._pushBlock$1 = function($0) { |
| 4672 return this._pushBlock($0, false); | 4747 return this._pushBlock($0, false); |
| 4673 }; | 4748 }; |
| 4674 MethodGenerator.prototype.evalBody$2 = MethodGenerator.prototype.evalBody; | 4749 MethodGenerator.prototype.evalBody$2 = MethodGenerator.prototype.evalBody; |
| 4675 MethodGenerator.prototype.run$0 = MethodGenerator.prototype.run; | 4750 MethodGenerator.prototype.run$0 = MethodGenerator.prototype.run; |
| 4676 MethodGenerator.prototype.visitAssertStatement$1 = MethodGenerator.prototype.vis
itAssertStatement; | |
| 4677 MethodGenerator.prototype.visitBinaryExpression$1 = function($0) { | 4751 MethodGenerator.prototype.visitBinaryExpression$1 = function($0) { |
| 4678 return this.visitBinaryExpression($0, false); | 4752 return this.visitBinaryExpression($0, false); |
| 4679 }; | 4753 }; |
| 4680 MethodGenerator.prototype.visitBlockStatement$1 = MethodGenerator.prototype.visi
tBlockStatement; | |
| 4681 MethodGenerator.prototype.visitBreakStatement$1 = MethodGenerator.prototype.visi
tBreakStatement; | |
| 4682 MethodGenerator.prototype.visitContinueStatement$1 = MethodGenerator.prototype.v
isitContinueStatement; | |
| 4683 MethodGenerator.prototype.visitDeclaredIdentifier$1 = MethodGenerator.prototype.
visitDeclaredIdentifier; | |
| 4684 MethodGenerator.prototype.visitDietStatement$1 = MethodGenerator.prototype.visit
DietStatement; | |
| 4685 MethodGenerator.prototype.visitDoStatement$1 = MethodGenerator.prototype.visitDo
Statement; | |
| 4686 MethodGenerator.prototype.visitEmptyStatement$1 = MethodGenerator.prototype.visi
tEmptyStatement; | |
| 4687 MethodGenerator.prototype.visitExpressionStatement$1 = MethodGenerator.prototype
.visitExpressionStatement; | |
| 4688 MethodGenerator.prototype.visitForInStatement$1 = MethodGenerator.prototype.visi
tForInStatement; | |
| 4689 MethodGenerator.prototype.visitForStatement$1 = MethodGenerator.prototype.visitF
orStatement; | |
| 4690 MethodGenerator.prototype.visitFunctionDefinition$1 = MethodGenerator.prototype.
visitFunctionDefinition; | |
| 4691 MethodGenerator.prototype.visitIfStatement$1 = MethodGenerator.prototype.visitIf
Statement; | |
| 4692 MethodGenerator.prototype.visitIndexExpression$1 = MethodGenerator.prototype.vis
itIndexExpression; | |
| 4693 MethodGenerator.prototype.visitLabeledStatement$1 = MethodGenerator.prototype.vi
sitLabeledStatement; | |
| 4694 MethodGenerator.prototype.visitLambdaExpression$1 = MethodGenerator.prototype.vi
sitLambdaExpression; | |
| 4695 MethodGenerator.prototype.visitLiteralExpression$1 = MethodGenerator.prototype.v
isitLiteralExpression; | |
| 4696 MethodGenerator.prototype.visitMapExpression$1 = MethodGenerator.prototype.visit
MapExpression; | |
| 4697 MethodGenerator.prototype.visitNewExpression$1 = MethodGenerator.prototype.visit
NewExpression; | |
| 4698 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { | 4754 MethodGenerator.prototype.visitPostfixExpression$1 = function($0) { |
| 4699 return this.visitPostfixExpression($0, false); | 4755 return this.visitPostfixExpression($0, false); |
| 4700 }; | 4756 }; |
| 4701 MethodGenerator.prototype.visitReturnStatement$1 = MethodGenerator.prototype.vis
itReturnStatement; | |
| 4702 MethodGenerator.prototype.visitSwitchStatement$1 = MethodGenerator.prototype.vis
itSwitchStatement; | |
| 4703 MethodGenerator.prototype.visitThrowStatement$1 = MethodGenerator.prototype.visi
tThrowStatement; | |
| 4704 MethodGenerator.prototype.visitTryStatement$1 = MethodGenerator.prototype.visitT
ryStatement; | |
| 4705 MethodGenerator.prototype.visitVariableDefinition$1 = MethodGenerator.prototype.
visitVariableDefinition; | |
| 4706 MethodGenerator.prototype.visitWhileStatement$1 = MethodGenerator.prototype.visi
tWhileStatement; | |
| 4707 MethodGenerator.prototype.writeDefinition$2 = MethodGenerator.prototype.writeDef
inition; | 4757 MethodGenerator.prototype.writeDefinition$2 = MethodGenerator.prototype.writeDef
inition; |
| 4708 // ********** Code for Arguments ************** | 4758 // ********** Code for Arguments ************** |
| 4709 function Arguments(nodes, values) { | 4759 function Arguments(nodes, values) { |
| 4710 this.nodes = nodes; | 4760 this.nodes = nodes; |
| 4711 this.values = values; | 4761 this.values = values; |
| 4712 } | 4762 } |
| 4713 Arguments.Arguments$bare$factory = function(arity) { | 4763 Arguments.Arguments$bare$factory = function(arity) { |
| 4714 var values = []; | 4764 var values = []; |
| 4715 for (var i = (0); | 4765 for (var i = (0); |
| 4716 i < arity; i++) { | 4766 i < arity; i++) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 4727 Arguments.prototype.get$nameCount = function() { | 4777 Arguments.prototype.get$nameCount = function() { |
| 4728 return this.get$length() - this.get$bareCount(); | 4778 return this.get$length() - this.get$bareCount(); |
| 4729 } | 4779 } |
| 4730 Arguments.prototype.get$hasNames = function() { | 4780 Arguments.prototype.get$hasNames = function() { |
| 4731 return this.get$bareCount() < this.get$length(); | 4781 return this.get$bareCount() < this.get$length(); |
| 4732 } | 4782 } |
| 4733 Arguments.prototype.get$length = function() { | 4783 Arguments.prototype.get$length = function() { |
| 4734 return this.values.get$length(); | 4784 return this.values.get$length(); |
| 4735 } | 4785 } |
| 4736 Arguments.prototype.getName = function(i) { | 4786 Arguments.prototype.getName = function(i) { |
| 4737 return this.nodes[i].get$label().get$name(); | 4787 return this.nodes.$index(i).get$label().get$name(); |
| 4738 } | 4788 } |
| 4739 Arguments.prototype.getIndexOfName = function(name) { | 4789 Arguments.prototype.getIndexOfName = function(name) { |
| 4740 for (var i = this.get$bareCount(); | 4790 for (var i = this.get$bareCount(); |
| 4741 i < this.get$length(); i++) { | 4791 i < this.get$length(); i++) { |
| 4742 if (this.getName(i) == name) { | 4792 if (this.getName(i) == name) { |
| 4743 return i; | 4793 return i; |
| 4744 } | 4794 } |
| 4745 } | 4795 } |
| 4746 return (-1); | 4796 return (-1); |
| 4747 } | 4797 } |
| 4748 Arguments.prototype.getValue = function(name) { | 4798 Arguments.prototype.getValue = function(name) { |
| 4749 var i = this.getIndexOfName(name); | 4799 var i = this.getIndexOfName(name); |
| 4750 return i >= (0) ? this.values[i] : null; | 4800 return i >= (0) ? this.values.$index(i) : null; |
| 4751 } | 4801 } |
| 4752 Arguments.prototype.get$bareCount = function() { | 4802 Arguments.prototype.get$bareCount = function() { |
| 4753 if (this._bareCount == null) { | 4803 if (this._bareCount == null) { |
| 4754 this._bareCount = this.get$length(); | 4804 this._bareCount = this.get$length(); |
| 4755 if (this.nodes != null) { | 4805 if (this.nodes != null) { |
| 4756 for (var i = (0); | 4806 for (var i = (0); |
| 4757 i < this.nodes.get$length(); i++) { | 4807 i < this.nodes.get$length(); i++) { |
| 4758 if (this.nodes[i].get$label() != null) { | 4808 if (this.nodes.$index(i).get$label() != null) { |
| 4759 this._bareCount = i; | 4809 this._bareCount = i; |
| 4760 break; | 4810 break; |
| 4761 } | 4811 } |
| 4762 } | 4812 } |
| 4763 } | 4813 } |
| 4764 } | 4814 } |
| 4765 return this._bareCount; | 4815 return this._bareCount; |
| 4766 } | 4816 } |
| 4767 Arguments.prototype.getCode = function() { | 4817 Arguments.prototype.getCode = function() { |
| 4768 var argsCode = []; | 4818 var argsCode = []; |
| 4769 for (var i = (0); | 4819 for (var i = (0); |
| 4770 i < this.get$length(); i++) { | 4820 i < this.get$length(); i++) { |
| 4771 argsCode.add$1(this.values[i].get$code()); | 4821 argsCode.add$1(this.values.$index(i).get$code()); |
| 4772 } | 4822 } |
| 4773 Arguments.removeTrailingNulls(argsCode); | 4823 Arguments.removeTrailingNulls(argsCode); |
| 4774 return Strings.join(argsCode, ", "); | 4824 return Strings.join(argsCode, ", "); |
| 4775 } | 4825 } |
| 4776 Arguments.removeTrailingNulls = function(argsCode) { | 4826 Arguments.removeTrailingNulls = function(argsCode) { |
| 4777 while (argsCode.get$length() > (0) && $eq(argsCode.last(), "null")) { | 4827 while (argsCode.get$length() > (0) && $eq(argsCode.last$0(), "null")) { |
| 4778 argsCode.removeLast(); | 4828 argsCode.removeLast$0(); |
| 4779 } | 4829 } |
| 4780 } | 4830 } |
| 4781 Arguments.prototype.getNames = function() { | 4831 Arguments.prototype.getNames = function() { |
| 4782 var names = []; | 4832 var names = []; |
| 4783 for (var i = this.get$bareCount(); | 4833 for (var i = this.get$bareCount(); |
| 4784 i < this.get$length(); i++) { | 4834 i < this.get$length(); i++) { |
| 4785 names.add$1(this.getName(i)); | 4835 names.add$1(this.getName(i)); |
| 4786 } | 4836 } |
| 4787 return names; | 4837 return names; |
| 4788 } | 4838 } |
| 4789 Arguments.prototype.toCallStubArgs = function() { | 4839 Arguments.prototype.toCallStubArgs = function() { |
| 4790 var result = []; | 4840 var result = []; |
| 4791 for (var i = (0); | 4841 for (var i = (0); |
| 4792 i < this.get$bareCount(); i++) { | 4842 i < this.get$bareCount(); i++) { |
| 4793 result.add$1(new VariableValue($globals.world.varType, ("$" + i), null, fals
e)); | 4843 result.add$1(new VariableValue($globals.world.varType, ("$" + i), null, fals
e)); |
| 4794 } | 4844 } |
| 4795 for (var i = this.get$bareCount(); | 4845 for (var i = this.get$bareCount(); |
| 4796 i < this.get$length(); i++) { | 4846 i < this.get$length(); i++) { |
| 4797 var name = this.getName(i); | 4847 var name = this.getName(i); |
| 4798 if (name == null) name = ("$" + i); | 4848 if (name == null) name = ("$" + i); |
| 4799 result.add$1(new VariableValue($globals.world.varType, name, null, false)); | 4849 result.add$1(new VariableValue($globals.world.varType, name, null, false)); |
| 4800 } | 4850 } |
| 4801 return new Arguments(this.nodes, result); | 4851 return new Arguments(this.nodes, result); |
| 4802 } | 4852 } |
| 4803 // ********** Code for ReturnKind ************** | |
| 4804 function ReturnKind() {} | |
| 4805 // ********** Code for LibraryImport ************** | 4853 // ********** Code for LibraryImport ************** |
| 4806 function LibraryImport(library, prefix, span) { | 4854 function LibraryImport(library, prefix, span) { |
| 4807 this.library = library; | 4855 this.library = library; |
| 4808 this.span = span; | 4856 this.span = span; |
| 4809 this.prefix = prefix; | 4857 this.prefix = prefix; |
| 4810 } | 4858 } |
| 4811 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; | 4859 LibraryImport.prototype.get$prefix = function() { return this.prefix; }; |
| 4812 LibraryImport.prototype.get$library = function() { return this.library; }; | 4860 LibraryImport.prototype.get$library = function() { return this.library; }; |
| 4813 LibraryImport.prototype.get$span = function() { return this.span; }; | 4861 LibraryImport.prototype.get$span = function() { return this.span; }; |
| 4814 // ********** Code for Member ************** | 4862 // ********** Code for Member ************** |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4894 return $globals.world.nonNullBool; | 4942 return $globals.world.nonNullBool; |
| 4895 } | 4943 } |
| 4896 return t; | 4944 return t; |
| 4897 } | 4945 } |
| 4898 Member.prototype.get$definition = function() { | 4946 Member.prototype.get$definition = function() { |
| 4899 return null; | 4947 return null; |
| 4900 } | 4948 } |
| 4901 Member.prototype.get$parameters = function() { | 4949 Member.prototype.get$parameters = function() { |
| 4902 return []; | 4950 return []; |
| 4903 } | 4951 } |
| 4904 Member.prototype.get$preciseMemberSet = function() { | |
| 4905 if (this._preciseMemberSet == null) { | |
| 4906 this._preciseMemberSet = new MemberSet(this, false); | |
| 4907 } | |
| 4908 return this._preciseMemberSet; | |
| 4909 } | |
| 4910 Member.prototype.get$potentialMemberSet = function() { | |
| 4911 if (this._potentialMemberSet == null) { | |
| 4912 if (this.declaringType.get$isObject()) { | |
| 4913 this._potentialMemberSet = $globals.world._members.$index(this.name); | |
| 4914 return this._potentialMemberSet; | |
| 4915 } | |
| 4916 var mems = new HashSetImplementation(); | |
| 4917 if (this.declaringType.get$isClass()) mems.add$1(this); | |
| 4918 var $$list = this.declaringType.get$subtypes(); | |
| 4919 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | |
| 4920 var subtype = $$i.next$0(); | |
| 4921 if (!subtype.get$isClass()) continue; | |
| 4922 var mem = subtype.get$members().$index(this.name); | |
| 4923 if (mem != null) { | |
| 4924 mems.add$1(mem); | |
| 4925 } | |
| 4926 else if (!this.declaringType.get$isClass()) { | |
| 4927 mem = subtype.getMember$1(this.name); | |
| 4928 if (mem != null) { | |
| 4929 mems.add$1(mem); | |
| 4930 } | |
| 4931 } | |
| 4932 } | |
| 4933 if ($ne(mems.get$length(), (0))) { | |
| 4934 for (var $$i = mems.iterator$0(); $$i.hasNext$0(); ) { | |
| 4935 var mem = $$i.next$0(); | |
| 4936 if (this._potentialMemberSet == null) { | |
| 4937 this._potentialMemberSet = new MemberSet(mem, false); | |
| 4938 } | |
| 4939 else { | |
| 4940 this._potentialMemberSet.add(mem); | |
| 4941 } | |
| 4942 } | |
| 4943 } | |
| 4944 } | |
| 4945 return this._potentialMemberSet; | |
| 4946 } | |
| 4947 Member.prototype.canInvoke = function(context, args) { | 4952 Member.prototype.canInvoke = function(context, args) { |
| 4948 return this.get$canGet() && new Value(this.get$returnType(), null, null).canIn
voke(context, ":call", args); | 4953 return this.get$canGet() && new Value(this.get$returnType(), null, null).canIn
voke(context, ":call", args); |
| 4949 } | 4954 } |
| 4950 Member.prototype.invoke = function(context, node, target, args, isDynamic) { | 4955 Member.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 4951 var newTarget = this._get(context, node, target, isDynamic); | 4956 var newTarget = this._get(context, node, target, isDynamic); |
| 4952 return newTarget.invoke$5(context, ":call", node, args, isDynamic); | 4957 return newTarget.invoke$5(context, ":call", node, args, isDynamic); |
| 4953 } | 4958 } |
| 4954 Member.prototype.override = function(other) { | 4959 Member.prototype.override = function(other) { |
| 4955 if (this.get$isStatic()) { | 4960 if (this.get$isStatic()) { |
| 4956 $globals.world.error("static members can not hide parent members", this.get$
span(), other.get$span()); | 4961 $globals.world.error("static members can not hide parent members", this.get$
span(), other.get$span()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 4975 var typeCode = this.declaringType == null ? (1) : this.declaringType.hashCode(
); | 4980 var typeCode = this.declaringType == null ? (1) : this.declaringType.hashCode(
); |
| 4976 var nameCode = this.get$isConstructor() ? this.get$constructorName().hashCode(
) : this.name.hashCode(); | 4981 var nameCode = this.get$isConstructor() ? this.get$constructorName().hashCode(
) : this.name.hashCode(); |
| 4977 return (typeCode << (4)) ^ nameCode; | 4982 return (typeCode << (4)) ^ nameCode; |
| 4978 } | 4983 } |
| 4979 Member.prototype.$eq = function(other) { | 4984 Member.prototype.$eq = function(other) { |
| 4980 return (other instanceof Member) && $eq(this.get$isConstructor(), other.get$is
Constructor()) && $eq(this.declaringType, other.get$declaringType()) && (this.ge
t$isConstructor() ? this.get$constructorName() == other.get$constructorName() :
this.name == other.get$name()); | 4985 return (other instanceof Member) && $eq(this.get$isConstructor(), other.get$is
Constructor()) && $eq(this.declaringType, other.get$declaringType()) && (this.ge
t$isConstructor() ? this.get$constructorName() == other.get$constructorName() :
this.name == other.get$name()); |
| 4981 } | 4986 } |
| 4982 Member.prototype._get$3 = Member.prototype._get; | 4987 Member.prototype._get$3 = Member.prototype._get; |
| 4983 Member.prototype._get$3$isDynamic = Member.prototype._get; | 4988 Member.prototype._get$3$isDynamic = Member.prototype._get; |
| 4984 Member.prototype._get$4 = Member.prototype._get; | 4989 Member.prototype._get$4 = Member.prototype._get; |
| 4990 Member.prototype._set$4 = Member.prototype._set; |
| 4985 Member.prototype._set$4$isDynamic = Member.prototype._set; | 4991 Member.prototype._set$4$isDynamic = Member.prototype._set; |
| 4986 Member.prototype._set$5 = Member.prototype._set; | 4992 Member.prototype._set$5 = Member.prototype._set; |
| 4987 Member.prototype.canInvoke$2 = Member.prototype.canInvoke; | 4993 Member.prototype.canInvoke$2 = Member.prototype.canInvoke; |
| 4988 Member.prototype.computeValue$0 = Member.prototype.computeValue; | 4994 Member.prototype.computeValue$0 = Member.prototype.computeValue; |
| 4989 Member.prototype.hashCode$0 = Member.prototype.hashCode; | 4995 Member.prototype.hashCode$0 = Member.prototype.hashCode; |
| 4990 Member.prototype.invoke$4 = function($0, $1, $2, $3) { | 4996 Member.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 4991 return this.invoke($0, $1, $2, $3, false); | 4997 return this.invoke($0, $1, $2, $3, false); |
| 4992 }; | 4998 }; |
| 4993 Member.prototype.invoke$4$isDynamic = Member.prototype.invoke; | 4999 Member.prototype.invoke$4$isDynamic = Member.prototype.invoke; |
| 4994 Member.prototype.invoke$5 = Member.prototype.invoke; | 5000 Member.prototype.invoke$5 = Member.prototype.invoke; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5073 Library.prototype._addMember = function(member) { | 5079 Library.prototype._addMember = function(member) { |
| 5074 if (member.get$isPrivate()) { | 5080 if (member.get$isPrivate()) { |
| 5075 if (member.get$isStatic()) { | 5081 if (member.get$isStatic()) { |
| 5076 if (member.declaringType.get$isTop()) { | 5082 if (member.declaringType.get$isTop()) { |
| 5077 $globals.world._addTopName(member); | 5083 $globals.world._addTopName(member); |
| 5078 } | 5084 } |
| 5079 return; | 5085 return; |
| 5080 } | 5086 } |
| 5081 var mset = this._privateMembers.$index(member.name); | 5087 var mset = this._privateMembers.$index(member.name); |
| 5082 if (mset == null) { | 5088 if (mset == null) { |
| 5083 var $$list = $globals.world.libraries.getValues(); | 5089 var $$list = $globals.world.libraries.getValues$0(); |
| 5084 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5090 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5085 var lib = $$i.next$0(); | 5091 var lib = $$i.next$0(); |
| 5086 if (lib.get$_privateMembers().containsKey$1(member.get$jsname())) { | 5092 if (lib.get$_privateMembers().containsKey$1(member.get$jsname())) { |
| 5087 member._jsname = ("_" + this.get$jsname() + member.get$jsname()); | 5093 member._jsname = ("_" + this.get$jsname() + member.get$jsname()); |
| 5088 break; | 5094 break; |
| 5089 } | 5095 } |
| 5090 } | 5096 } |
| 5091 mset = new MemberSet(member, true); | 5097 mset = new MemberSet(member, true); |
| 5092 this._privateMembers.$setindex(member.name, mset); | 5098 this._privateMembers.$setindex(member.name, mset); |
| 5093 } | 5099 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5127 Library.prototype.findType = function(type) { | 5133 Library.prototype.findType = function(type) { |
| 5128 var result = this.findTypeByName(type.name.name); | 5134 var result = this.findTypeByName(type.name.name); |
| 5129 if (result == null) return null; | 5135 if (result == null) return null; |
| 5130 if (type.names != null) { | 5136 if (type.names != null) { |
| 5131 if (type.names.get$length() > (1)) { | 5137 if (type.names.get$length() > (1)) { |
| 5132 return null; | 5138 return null; |
| 5133 } | 5139 } |
| 5134 if (!result.get$isTop()) { | 5140 if (!result.get$isTop()) { |
| 5135 return null; | 5141 return null; |
| 5136 } | 5142 } |
| 5137 return result.get$library().findTypeByName(type.names[(0)].get$name()); | 5143 return result.get$library().findTypeByName(type.names.$index((0)).get$name()
); |
| 5138 } | 5144 } |
| 5139 return result; | 5145 return result; |
| 5140 } | 5146 } |
| 5141 Library.prototype.findTypeByName = function(name) { | 5147 Library.prototype.findTypeByName = function(name) { |
| 5142 var ret = this.types.$index(name); | 5148 var ret = this.types.$index(name); |
| 5143 var $$list = this.imports; | 5149 var $$list = this.imports; |
| 5144 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5150 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5145 var imported = $$list[$$i]; | 5151 var imported = $$list.$index($$i); |
| 5146 var newRet = null; | 5152 var newRet = null; |
| 5147 if (imported.get$prefix() == null) { | 5153 if (imported.get$prefix() == null) { |
| 5148 newRet = imported.get$library().get$types().$index(name); | 5154 newRet = imported.get$library().get$types().$index(name); |
| 5149 } | 5155 } |
| 5150 else if ($eq(imported.get$prefix(), name)) { | 5156 else if ($eq(imported.get$prefix(), name)) { |
| 5151 newRet = imported.get$library().get$topType(); | 5157 newRet = imported.get$library().get$topType(); |
| 5152 } | 5158 } |
| 5153 if (newRet != null) { | 5159 if (newRet != null) { |
| 5154 if (ret != null && $ne(ret, newRet)) { | 5160 if (ret != null && $ne(ret, newRet)) { |
| 5155 $globals.world.error(("conflicting types for \"" + name + "\""), ret.get
$span(), newRet.get$span()); | 5161 $globals.world.error(("conflicting types for \"" + name + "\""), ret.get
$span(), newRet.get$span()); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5199 var index = this.name.lastIndexOf("/", this.name.length); | 5205 var index = this.name.lastIndexOf("/", this.name.length); |
| 5200 if (index >= (0)) { | 5206 if (index >= (0)) { |
| 5201 this.name = this.name.substring($add(index, (1))); | 5207 this.name = this.name.substring($add(index, (1))); |
| 5202 } | 5208 } |
| 5203 index = this.name.indexOf("."); | 5209 index = this.name.indexOf("."); |
| 5204 if (index > (0)) { | 5210 if (index > (0)) { |
| 5205 this.name = this.name.substring((0), index); | 5211 this.name = this.name.substring((0), index); |
| 5206 } | 5212 } |
| 5207 } | 5213 } |
| 5208 this._jsname = this.name.replaceAll(".", "_").replaceAll(":", "_").replaceAll(
" ", "_"); | 5214 this._jsname = this.name.replaceAll(".", "_").replaceAll(":", "_").replaceAll(
" ", "_"); |
| 5209 var $$list = this.types.getValues(); | 5215 var $$list = this.types.getValues$0(); |
| 5210 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5216 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5211 var type = $$i.next$0(); | 5217 var type = $$i.next$0(); |
| 5212 type.resolve$0(); | 5218 type.resolve$0(); |
| 5213 } | 5219 } |
| 5214 } | 5220 } |
| 5215 Library.prototype._addTopName = function(name, member, localSpan) { | 5221 Library.prototype._addTopName = function(name, member, localSpan) { |
| 5216 var existing = this._topNames.$index(name); | 5222 var existing = this._topNames.$index(name); |
| 5217 if (existing == null) { | 5223 if (existing == null) { |
| 5218 this._topNames.$setindex(name, member); | 5224 this._topNames.$setindex(name, member); |
| 5219 } | 5225 } |
| 5220 else { | 5226 else { |
| 5221 if ((existing instanceof AmbiguousMember)) { | 5227 if ((existing instanceof AmbiguousMember)) { |
| 5222 existing.get$members().add$1(member); | 5228 existing.get$members().add$1(member); |
| 5223 } | 5229 } |
| 5224 else { | 5230 else { |
| 5225 var newMember = new AmbiguousMember(name, [existing, member]); | 5231 var newMember = new AmbiguousMember(name, [existing, member]); |
| 5226 $globals.world.error(("conflicting members for \"" + name + "\""), existin
g.get$span(), member.get$span(), localSpan); | 5232 $globals.world.error(("conflicting members for \"" + name + "\""), existin
g.get$span(), member.get$span(), localSpan); |
| 5227 this._topNames.$setindex(name, newMember); | 5233 this._topNames.$setindex(name, newMember); |
| 5228 } | 5234 } |
| 5229 } | 5235 } |
| 5230 } | 5236 } |
| 5231 Library.prototype._addTopNames = function(lib) { | 5237 Library.prototype._addTopNames = function(lib) { |
| 5232 var $$list = lib.topType.members.getValues(); | 5238 var $$list = lib.topType.members.getValues$0(); |
| 5233 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5239 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5234 var member = $$i.next$0(); | 5240 var member = $$i.next$0(); |
| 5235 if (member.get$isPrivate() && $ne(lib, this)) continue; | 5241 if (member.get$isPrivate() && $ne(lib, this)) continue; |
| 5236 this._addTopName(member.get$name(), member); | 5242 this._addTopName(member.get$name(), member); |
| 5237 } | 5243 } |
| 5238 var $$list = lib.types.getValues(); | 5244 var $$list = lib.types.getValues$0(); |
| 5239 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 5245 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 5240 var type = $$i.next$0(); | 5246 var type = $$i.next$0(); |
| 5241 if (!type.get$isTop()) { | 5247 if (!type.get$isTop()) { |
| 5242 if ($ne(lib, this) && type.get$typeMember().get$isPrivate()) continue; | 5248 if ($ne(lib, this) && type.get$typeMember().get$isPrivate()) continue; |
| 5243 this._addTopName(type.get$name(), type.get$typeMember()); | 5249 this._addTopName(type.get$name(), type.get$typeMember()); |
| 5244 } | 5250 } |
| 5245 } | 5251 } |
| 5246 } | 5252 } |
| 5247 Library.prototype.postResolveChecks = function() { | 5253 Library.prototype.postResolveChecks = function() { |
| 5248 this._topNames = new HashMapImplementation(); | 5254 this._topNames = new HashMapImplementation(); |
| 5249 this._addTopNames(this); | 5255 this._addTopNames(this); |
| 5250 var $$list = this.imports; | 5256 var $$list = this.imports; |
| 5251 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5257 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5252 var imported = $$list[$$i]; | 5258 var imported = $$list.$index($$i); |
| 5253 if (imported.get$prefix() == null) { | 5259 if (imported.get$prefix() == null) { |
| 5254 this._addTopNames(imported.get$library()); | 5260 this._addTopNames(imported.get$library()); |
| 5255 } | 5261 } |
| 5256 else { | 5262 else { |
| 5257 this._addTopName(imported.get$prefix(), imported.get$library().get$topType
().get$typeMember(), imported.get$span()); | 5263 this._addTopName(imported.get$prefix(), imported.get$library().get$topType
().get$typeMember(), imported.get$span()); |
| 5258 } | 5264 } |
| 5259 } | 5265 } |
| 5260 } | 5266 } |
| 5261 Library.prototype.visitSources = function() { | 5267 Library.prototype.visitSources = function() { |
| 5262 var visitor = new _LibraryVisitor(this); | 5268 var visitor = new _LibraryVisitor(this); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5413 _LibraryVisitor.prototype.getSingleStringArg = function(node) { | 5419 _LibraryVisitor.prototype.getSingleStringArg = function(node) { |
| 5414 if (node.arguments.get$length() != (1)) { | 5420 if (node.arguments.get$length() != (1)) { |
| 5415 $globals.world.error(("expected exactly one argument but found " + node.argu
ments.get$length()), node.span); | 5421 $globals.world.error(("expected exactly one argument but found " + node.argu
ments.get$length()), node.span); |
| 5416 } | 5422 } |
| 5417 return this.getFirstStringArg(node); | 5423 return this.getFirstStringArg(node); |
| 5418 } | 5424 } |
| 5419 _LibraryVisitor.prototype.getFirstStringArg = function(node) { | 5425 _LibraryVisitor.prototype.getFirstStringArg = function(node) { |
| 5420 if (node.arguments.get$length() < (1)) { | 5426 if (node.arguments.get$length() < (1)) { |
| 5421 $globals.world.error(("expected at least one argument but found " + node.arg
uments.get$length()), node.span); | 5427 $globals.world.error(("expected at least one argument but found " + node.arg
uments.get$length()), node.span); |
| 5422 } | 5428 } |
| 5423 var arg = node.arguments[(0)]; | 5429 var arg = node.arguments.$index((0)); |
| 5424 if (arg.get$label() != null) { | 5430 if (arg.get$label() != null) { |
| 5425 $globals.world.error("label not allowed for directive", node.span); | 5431 $globals.world.error("label not allowed for directive", node.span); |
| 5426 } | 5432 } |
| 5427 return this._parseStringArgument(arg); | 5433 return this._parseStringArgument(arg); |
| 5428 } | 5434 } |
| 5429 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { | 5435 _LibraryVisitor.prototype.tryGetNamedStringArg = function(node, argName) { |
| 5430 var args = node.arguments.filter$1((function (a) { | 5436 var args = node.arguments.filter$1((function (a) { |
| 5431 return a.get$label() != null && $eq(a.get$label().get$name(), argName); | 5437 return a.get$label() != null && $eq(a.get$label().get$name(), argName); |
| 5432 }) | 5438 }) |
| 5433 ); | 5439 ); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 5447 if (!(expr instanceof LiteralExpression) || !expr.get$value().get$type().get$i
sString()) { | 5453 if (!(expr instanceof LiteralExpression) || !expr.get$value().get$type().get$i
sString()) { |
| 5448 $globals.world.error("expected string literal", expr.get$span()); | 5454 $globals.world.error("expected string literal", expr.get$span()); |
| 5449 } | 5455 } |
| 5450 return expr.get$value().get$actualValue(); | 5456 return expr.get$value().get$actualValue(); |
| 5451 } | 5457 } |
| 5452 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { | 5458 _LibraryVisitor.prototype.visitTypeDefinition = function(node) { |
| 5453 var oldType = this.currentType; | 5459 var oldType = this.currentType; |
| 5454 this.currentType = this.library.addType(node.name.name, node, node.isClass); | 5460 this.currentType = this.library.addType(node.name.name, node, node.isClass); |
| 5455 var $$list = node.body; | 5461 var $$list = node.body; |
| 5456 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5462 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5457 var member = $$list[$$i]; | 5463 var member = $$list.$index($$i); |
| 5458 member.visit$1(this); | 5464 member.visit$1(this); |
| 5459 } | 5465 } |
| 5460 this.currentType = oldType; | 5466 this.currentType = oldType; |
| 5461 } | 5467 } |
| 5462 _LibraryVisitor.prototype.visitVariableDefinition = function(node) { | 5468 _LibraryVisitor.prototype.visitVariableDefinition = function(node) { |
| 5463 this.currentType.addField(node); | 5469 this.currentType.addField(node); |
| 5464 } | 5470 } |
| 5465 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) { | 5471 _LibraryVisitor.prototype.visitFunctionDefinition = function(node) { |
| 5466 this.currentType.addMethod(node.name.name, node); | 5472 this.currentType.addMethod(node.name.name, node); |
| 5467 } | 5473 } |
| 5468 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { | 5474 _LibraryVisitor.prototype.visitFunctionTypeDefinition = function(node) { |
| 5469 var type = this.library.addType(node.func.name.name, node, false); | 5475 var type = this.library.addType(node.func.name.name, node, false); |
| 5470 type.addMethod$2(":call", node.func); | 5476 type.addMethod$2(":call", node.func); |
| 5471 } | 5477 } |
| 5472 _LibraryVisitor.prototype.addSource$1 = _LibraryVisitor.prototype.addSource; | 5478 _LibraryVisitor.prototype.addSource$1 = _LibraryVisitor.prototype.addSource; |
| 5473 _LibraryVisitor.prototype.visitFunctionDefinition$1 = _LibraryVisitor.prototype.
visitFunctionDefinition; | |
| 5474 _LibraryVisitor.prototype.visitVariableDefinition$1 = _LibraryVisitor.prototype.
visitVariableDefinition; | |
| 5475 // ********** Code for Parameter ************** | 5479 // ********** Code for Parameter ************** |
| 5476 function Parameter(definition, method) { | 5480 function Parameter(definition, method) { |
| 5477 this.method = method; | 5481 this.method = method; |
| 5478 this.definition = definition; | 5482 this.definition = definition; |
| 5479 this.isInitializer = false; | 5483 this.isInitializer = false; |
| 5480 } | 5484 } |
| 5481 Parameter.prototype.get$definition = function() { return this.definition; }; | 5485 Parameter.prototype.get$definition = function() { return this.definition; }; |
| 5482 Parameter.prototype.set$definition = function(value) { return this.definition =
value; }; | 5486 Parameter.prototype.set$definition = function(value) { return this.definition =
value; }; |
| 5483 Parameter.prototype.get$method = function() { return this.method; }; | 5487 Parameter.prototype.get$method = function() { return this.method; }; |
| 5484 Parameter.prototype.set$method = function(value) { return this.method = value; }
; | 5488 Parameter.prototype.set$method = function(value) { return this.method = value; }
; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5575 $globals.world.error("cannot set type", node.span); | 5579 $globals.world.error("cannot set type", node.span); |
| 5576 } | 5580 } |
| 5577 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { | 5581 TypeMember.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 5578 $globals.world.error("cannot invoke type", node.span); | 5582 $globals.world.error("cannot invoke type", node.span); |
| 5579 } | 5583 } |
| 5580 TypeMember.prototype._get$3 = function($0, $1, $2) { | 5584 TypeMember.prototype._get$3 = function($0, $1, $2) { |
| 5581 return this._get($0, $1, $2, false); | 5585 return this._get($0, $1, $2, false); |
| 5582 }; | 5586 }; |
| 5583 TypeMember.prototype._get$3$isDynamic = TypeMember.prototype._get; | 5587 TypeMember.prototype._get$3$isDynamic = TypeMember.prototype._get; |
| 5584 TypeMember.prototype._get$4 = TypeMember.prototype._get; | 5588 TypeMember.prototype._get$4 = TypeMember.prototype._get; |
| 5589 TypeMember.prototype._set$4 = function($0, $1, $2, $3) { |
| 5590 return this._set($0, $1, $2, $3, false); |
| 5591 }; |
| 5585 TypeMember.prototype._set$4$isDynamic = TypeMember.prototype._set; | 5592 TypeMember.prototype._set$4$isDynamic = TypeMember.prototype._set; |
| 5586 TypeMember.prototype._set$5 = TypeMember.prototype._set; | 5593 TypeMember.prototype._set$5 = TypeMember.prototype._set; |
| 5587 TypeMember.prototype.canInvoke$2 = TypeMember.prototype.canInvoke; | 5594 TypeMember.prototype.canInvoke$2 = TypeMember.prototype.canInvoke; |
| 5588 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 5595 TypeMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 5589 return this.invoke($0, $1, $2, $3, false); | 5596 return this.invoke($0, $1, $2, $3, false); |
| 5590 }; | 5597 }; |
| 5591 TypeMember.prototype.invoke$4$isDynamic = TypeMember.prototype.invoke; | 5598 TypeMember.prototype.invoke$4$isDynamic = TypeMember.prototype.invoke; |
| 5592 TypeMember.prototype.invoke$5 = TypeMember.prototype.invoke; | 5599 TypeMember.prototype.invoke$5 = TypeMember.prototype.invoke; |
| 5593 // ********** Code for FieldMember ************** | 5600 // ********** Code for FieldMember ************** |
| 5594 $inherits(FieldMember, Member); | 5601 $inherits(FieldMember, Member); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5639 } | 5646 } |
| 5640 FieldMember.prototype.get$isField = function() { | 5647 FieldMember.prototype.get$isField = function() { |
| 5641 return true; | 5648 return true; |
| 5642 } | 5649 } |
| 5643 FieldMember.prototype.resolve = function() { | 5650 FieldMember.prototype.resolve = function() { |
| 5644 this.isStatic = this.declaringType.get$isTop(); | 5651 this.isStatic = this.declaringType.get$isTop(); |
| 5645 this.isFinal = false; | 5652 this.isFinal = false; |
| 5646 if (this.definition.modifiers != null) { | 5653 if (this.definition.modifiers != null) { |
| 5647 var $$list = this.definition.modifiers; | 5654 var $$list = this.definition.modifiers; |
| 5648 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5655 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5649 var mod = $$list[$$i]; | 5656 var mod = $$list.$index($$i); |
| 5650 if ($eq(mod.get$kind(), (85))) { | 5657 if ($eq(mod.get$kind(), (85))) { |
| 5651 if (this.isStatic) { | 5658 if (this.isStatic) { |
| 5652 $globals.world.error("duplicate static modifier", mod.get$span()); | 5659 $globals.world.error("duplicate static modifier", mod.get$span()); |
| 5653 } | 5660 } |
| 5654 this.isStatic = true; | 5661 this.isStatic = true; |
| 5655 } | 5662 } |
| 5656 else if ($eq(mod.get$kind(), (99))) { | 5663 else if ($eq(mod.get$kind(), (99))) { |
| 5657 if (this.isFinal) { | 5664 if (this.isFinal) { |
| 5658 $globals.world.error("duplicate final modifier", mod.get$span()); | 5665 $globals.world.error("duplicate final modifier", mod.get$span()); |
| 5659 } | 5666 } |
| 5660 this.isFinal = true; | 5667 this.isFinal = true; |
| 5661 } | 5668 } |
| 5662 else { | 5669 else { |
| 5663 $globals.world.error(("" + mod + " modifier not allowed on field"), mod.
get$span()); | 5670 $globals.world.error(("" + mod + " modifier not allowed on field"), mod.
get$span()); |
| 5664 } | 5671 } |
| 5665 } | 5672 } |
| 5666 } | 5673 } |
| 5667 this.type = this.resolveType$2(this.definition.type, false); | 5674 this.type = this.resolveType(this.definition.type, false); |
| 5668 if (this.isStatic && !this.get$isFactory() && this.type.get$hasTypeParams()) { | 5675 if (this.isStatic && !this.get$isFactory() && this.type.get$hasTypeParams()) { |
| 5669 $globals.world.error("using type parameter in static context", this.definiti
on.type.span); | 5676 $globals.world.error("using type parameter in static context", this.definiti
on.type.span); |
| 5670 } | 5677 } |
| 5671 if (this.isStatic && this.isFinal && this.value == null) { | 5678 if (this.isStatic && this.isFinal && this.value == null) { |
| 5672 $globals.world.error("static final field is missing initializer", this.get$s
pan()); | 5679 $globals.world.error("static final field is missing initializer", this.get$s
pan()); |
| 5673 } | 5680 } |
| 5674 this.get$library()._addMember(this); | 5681 this.get$library()._addMember(this); |
| 5675 } | 5682 } |
| 5676 FieldMember.prototype.computeValue = function() { | 5683 FieldMember.prototype.computeValue = function() { |
| 5677 if (this.value == null) return null; | 5684 if (this.value == null) return null; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5745 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { | 5752 FieldMember.prototype._set = function(context, node, target, value, isDynamic) { |
| 5746 var lhs = this._get(context, node, target, isDynamic); | 5753 var lhs = this._get(context, node, target, isDynamic); |
| 5747 value = value.convertTo(context, this.type, isDynamic); | 5754 value = value.convertTo(context, this.type, isDynamic); |
| 5748 return new Value(this.type, ("" + lhs.get$code() + " = " + value.get$code()),
node.span); | 5755 return new Value(this.type, ("" + lhs.get$code() + " = " + value.get$code()),
node.span); |
| 5749 } | 5756 } |
| 5750 FieldMember.prototype._get$3 = function($0, $1, $2) { | 5757 FieldMember.prototype._get$3 = function($0, $1, $2) { |
| 5751 return this._get($0, $1, $2, false); | 5758 return this._get($0, $1, $2, false); |
| 5752 }; | 5759 }; |
| 5753 FieldMember.prototype._get$3$isDynamic = FieldMember.prototype._get; | 5760 FieldMember.prototype._get$3$isDynamic = FieldMember.prototype._get; |
| 5754 FieldMember.prototype._get$4 = FieldMember.prototype._get; | 5761 FieldMember.prototype._get$4 = FieldMember.prototype._get; |
| 5762 FieldMember.prototype._set$4 = function($0, $1, $2, $3) { |
| 5763 return this._set($0, $1, $2, $3, false); |
| 5764 }; |
| 5755 FieldMember.prototype._set$4$isDynamic = FieldMember.prototype._set; | 5765 FieldMember.prototype._set$4$isDynamic = FieldMember.prototype._set; |
| 5756 FieldMember.prototype._set$5 = FieldMember.prototype._set; | 5766 FieldMember.prototype._set$5 = FieldMember.prototype._set; |
| 5757 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; | 5767 FieldMember.prototype.computeValue$0 = FieldMember.prototype.computeValue; |
| 5758 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS
yntax; | 5768 FieldMember.prototype.provideFieldSyntax$0 = FieldMember.prototype.provideFieldS
yntax; |
| 5759 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro
pertySyntax; | 5769 FieldMember.prototype.providePropertySyntax$0 = FieldMember.prototype.providePro
pertySyntax; |
| 5760 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve; | 5770 FieldMember.prototype.resolve$0 = FieldMember.prototype.resolve; |
| 5761 // ********** Code for PropertyMember ************** | 5771 // ********** Code for PropertyMember ************** |
| 5762 $inherits(PropertyMember, Member); | 5772 $inherits(PropertyMember, Member); |
| 5763 function PropertyMember(name, declaringType) { | 5773 function PropertyMember(name, declaringType) { |
| 5764 Member.call(this, name, declaringType); | 5774 Member.call(this, name, declaringType); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5857 $globals.world.warning("setter methods should be void", this.setter.defini
tion.returnType.span); | 5867 $globals.world.warning("setter methods should be void", this.setter.defini
tion.returnType.span); |
| 5858 } | 5868 } |
| 5859 } | 5869 } |
| 5860 this.get$library()._addMember(this); | 5870 this.get$library()._addMember(this); |
| 5861 } | 5871 } |
| 5862 PropertyMember.prototype._get$3 = function($0, $1, $2) { | 5872 PropertyMember.prototype._get$3 = function($0, $1, $2) { |
| 5863 return this._get($0, $1, $2, false); | 5873 return this._get($0, $1, $2, false); |
| 5864 }; | 5874 }; |
| 5865 PropertyMember.prototype._get$3$isDynamic = PropertyMember.prototype._get; | 5875 PropertyMember.prototype._get$3$isDynamic = PropertyMember.prototype._get; |
| 5866 PropertyMember.prototype._get$4 = PropertyMember.prototype._get; | 5876 PropertyMember.prototype._get$4 = PropertyMember.prototype._get; |
| 5877 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) { |
| 5878 return this._set($0, $1, $2, $3, false); |
| 5879 }; |
| 5867 PropertyMember.prototype._set$4$isDynamic = PropertyMember.prototype._set; | 5880 PropertyMember.prototype._set$4$isDynamic = PropertyMember.prototype._set; |
| 5868 PropertyMember.prototype._set$5 = PropertyMember.prototype._set; | 5881 PropertyMember.prototype._set$5 = PropertyMember.prototype._set; |
| 5869 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide
FieldSyntax; | 5882 PropertyMember.prototype.provideFieldSyntax$0 = PropertyMember.prototype.provide
FieldSyntax; |
| 5870 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov
idePropertySyntax; | 5883 PropertyMember.prototype.providePropertySyntax$0 = PropertyMember.prototype.prov
idePropertySyntax; |
| 5871 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve; | 5884 PropertyMember.prototype.resolve$0 = PropertyMember.prototype.resolve; |
| 5872 // ********** Code for ConcreteMember ************** | 5885 // ********** Code for ConcreteMember ************** |
| 5873 $inherits(ConcreteMember, Member); | 5886 $inherits(ConcreteMember, Member); |
| 5874 function ConcreteMember(name, declaringType, baseMember) { | 5887 function ConcreteMember(name, declaringType, baseMember) { |
| 5875 this.baseMember = baseMember; | 5888 this.baseMember = baseMember; |
| 5876 Member.call(this, name, declaringType); | 5889 Member.call(this, name, declaringType); |
| 5877 this.parameters = []; | 5890 this.parameters = []; |
| 5878 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring
Type); | 5891 this.returnType = this.baseMember.get$returnType().resolveTypeParams(declaring
Type); |
| 5879 var $$list = this.baseMember.get$parameters(); | 5892 var $$list = this.baseMember.get$parameters(); |
| 5880 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 5893 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 5881 var p = $$list[$$i]; | 5894 var p = $$list.$index($$i); |
| 5882 var newType = p.get$type().resolveTypeParams$1(declaringType); | 5895 var newType = p.get$type().resolveTypeParams$1(declaringType); |
| 5883 if ($ne(newType, p.get$type())) { | 5896 if ($ne(newType, p.get$type())) { |
| 5884 this.parameters.add(p.copyWithNewType$2(this, newType)); | 5897 this.parameters.add(p.copyWithNewType$2(this, newType)); |
| 5885 } | 5898 } |
| 5886 else { | 5899 else { |
| 5887 this.parameters.add(p); | 5900 this.parameters.add(p); |
| 5888 } | 5901 } |
| 5889 } | 5902 } |
| 5890 } | 5903 } |
| 5891 ConcreteMember.prototype.get$returnType = function() { return this.returnType; }
; | 5904 ConcreteMember.prototype.get$returnType = function() { return this.returnType; }
; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5992 this.declaringType.genMethod(this); | 6005 this.declaringType.genMethod(this); |
| 5993 } | 6006 } |
| 5994 return new Value(this.get$inferredResult(), code, node.span); | 6007 return new Value(this.get$inferredResult(), code, node.span); |
| 5995 } | 6008 } |
| 5996 ConcreteMember.prototype._evalConstConstructor$2 = ConcreteMember.prototype._eva
lConstConstructor; | 6009 ConcreteMember.prototype._evalConstConstructor$2 = ConcreteMember.prototype._eva
lConstConstructor; |
| 5997 ConcreteMember.prototype._get$3 = function($0, $1, $2) { | 6010 ConcreteMember.prototype._get$3 = function($0, $1, $2) { |
| 5998 return this._get($0, $1, $2, false); | 6011 return this._get($0, $1, $2, false); |
| 5999 }; | 6012 }; |
| 6000 ConcreteMember.prototype._get$3$isDynamic = ConcreteMember.prototype._get; | 6013 ConcreteMember.prototype._get$3$isDynamic = ConcreteMember.prototype._get; |
| 6001 ConcreteMember.prototype._get$4 = ConcreteMember.prototype._get; | 6014 ConcreteMember.prototype._get$4 = ConcreteMember.prototype._get; |
| 6015 ConcreteMember.prototype._set$4 = function($0, $1, $2, $3) { |
| 6016 return this._set($0, $1, $2, $3, false); |
| 6017 }; |
| 6002 ConcreteMember.prototype._set$4$isDynamic = ConcreteMember.prototype._set; | 6018 ConcreteMember.prototype._set$4$isDynamic = ConcreteMember.prototype._set; |
| 6003 ConcreteMember.prototype._set$5 = ConcreteMember.prototype._set; | 6019 ConcreteMember.prototype._set$5 = ConcreteMember.prototype._set; |
| 6004 ConcreteMember.prototype.canInvoke$2 = ConcreteMember.prototype.canInvoke; | 6020 ConcreteMember.prototype.canInvoke$2 = ConcreteMember.prototype.canInvoke; |
| 6005 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; | 6021 ConcreteMember.prototype.computeValue$0 = ConcreteMember.prototype.computeValue; |
| 6006 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 6022 ConcreteMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6007 return this.invoke($0, $1, $2, $3, false); | 6023 return this.invoke($0, $1, $2, $3, false); |
| 6008 }; | 6024 }; |
| 6009 ConcreteMember.prototype.invoke$4$isDynamic = ConcreteMember.prototype.invoke; | 6025 ConcreteMember.prototype.invoke$4$isDynamic = ConcreteMember.prototype.invoke; |
| 6010 ConcreteMember.prototype.invoke$5 = ConcreteMember.prototype.invoke; | 6026 ConcreteMember.prototype.invoke$5 = ConcreteMember.prototype.invoke; |
| 6011 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide
FieldSyntax; | 6027 ConcreteMember.prototype.provideFieldSyntax$0 = ConcreteMember.prototype.provide
FieldSyntax; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6095 return false; | 6111 return false; |
| 6096 } | 6112 } |
| 6097 } | 6113 } |
| 6098 MethodMember.prototype.canInvoke = function(context, args) { | 6114 MethodMember.prototype.canInvoke = function(context, args) { |
| 6099 var bareCount = args.get$bareCount(); | 6115 var bareCount = args.get$bareCount(); |
| 6100 if (bareCount > this.parameters.get$length()) return false; | 6116 if (bareCount > this.parameters.get$length()) return false; |
| 6101 if (bareCount == this.parameters.get$length()) { | 6117 if (bareCount == this.parameters.get$length()) { |
| 6102 if (bareCount != args.get$length()) return false; | 6118 if (bareCount != args.get$length()) return false; |
| 6103 } | 6119 } |
| 6104 else { | 6120 else { |
| 6105 if (!this.parameters[bareCount].get$isOptional()) return false; | 6121 if (!this.parameters.$index(bareCount).get$isOptional()) return false; |
| 6106 for (var i = bareCount; | 6122 for (var i = bareCount; |
| 6107 i < args.get$length(); i++) { | 6123 i < args.get$length(); i++) { |
| 6108 if (this.indexOfParameter(args.getName(i)) < (0)) { | 6124 if (this.indexOfParameter(args.getName(i)) < (0)) { |
| 6109 return false; | 6125 return false; |
| 6110 } | 6126 } |
| 6111 } | 6127 } |
| 6112 } | 6128 } |
| 6113 return true; | 6129 return true; |
| 6114 } | 6130 } |
| 6115 MethodMember.prototype.indexOfParameter = function(name) { | 6131 MethodMember.prototype.indexOfParameter = function(name) { |
| 6116 for (var i = (0); | 6132 for (var i = (0); |
| 6117 i < this.parameters.get$length(); i++) { | 6133 i < this.parameters.get$length(); i++) { |
| 6118 var p = this.parameters[i]; | 6134 var p = this.parameters.$index(i); |
| 6119 if (p.get$isOptional() && $eq(p.get$name(), name)) { | 6135 if (p.get$isOptional() && $eq(p.get$name(), name)) { |
| 6120 return i; | 6136 return i; |
| 6121 } | 6137 } |
| 6122 } | 6138 } |
| 6123 return (-1); | 6139 return (-1); |
| 6124 } | 6140 } |
| 6125 MethodMember.prototype.provideFieldSyntax = function() { | 6141 MethodMember.prototype.provideFieldSyntax = function() { |
| 6126 this._provideFieldSyntax = true; | 6142 this._provideFieldSyntax = true; |
| 6127 } | 6143 } |
| 6128 MethodMember.prototype.providePropertySyntax = function() { | 6144 MethodMember.prototype.providePropertySyntax = function() { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 6142 this._providePropertySyntax = true; | 6158 this._providePropertySyntax = true; |
| 6143 return new Value(this.get$functionType(), ("" + target.get$code() + ".get$" +
this.get$jsname() + "()"), node.span); | 6159 return new Value(this.get$functionType(), ("" + target.get$code() + ".get$" +
this.get$jsname() + "()"), node.span); |
| 6144 } | 6160 } |
| 6145 MethodMember.prototype.namesInHomePositions = function(args) { | 6161 MethodMember.prototype.namesInHomePositions = function(args) { |
| 6146 if (!args.get$hasNames()) return true; | 6162 if (!args.get$hasNames()) return true; |
| 6147 for (var i = args.get$bareCount(); | 6163 for (var i = args.get$bareCount(); |
| 6148 i < args.values.get$length(); i++) { | 6164 i < args.values.get$length(); i++) { |
| 6149 if (i >= this.parameters.get$length()) { | 6165 if (i >= this.parameters.get$length()) { |
| 6150 return false; | 6166 return false; |
| 6151 } | 6167 } |
| 6152 if (args.getName(i) != this.parameters[i].get$name()) { | 6168 if (args.getName(i) != this.parameters.$index(i).get$name()) { |
| 6153 return false; | 6169 return false; |
| 6154 } | 6170 } |
| 6155 } | 6171 } |
| 6156 return true; | 6172 return true; |
| 6157 } | 6173 } |
| 6158 MethodMember.prototype.namesInOrder = function(args) { | 6174 MethodMember.prototype.namesInOrder = function(args) { |
| 6159 if (!args.get$hasNames()) return true; | 6175 if (!args.get$hasNames()) return true; |
| 6160 var lastParameter = null; | 6176 var lastParameter = null; |
| 6161 for (var i = args.get$bareCount(); | 6177 for (var i = args.get$bareCount(); |
| 6162 i < this.parameters.get$length(); i++) { | 6178 i < this.parameters.get$length(); i++) { |
| 6163 var p = args.getIndexOfName(this.parameters[i].get$name()); | 6179 var p = args.getIndexOfName(this.parameters.$index(i).get$name()); |
| 6164 if (p >= (0) && args.values[p].get$needsTemp()) { | 6180 if (p >= (0) && args.values.$index(p).get$needsTemp()) { |
| 6165 if (lastParameter != null && lastParameter > p) { | 6181 if (lastParameter != null && lastParameter > p) { |
| 6166 return false; | 6182 return false; |
| 6167 } | 6183 } |
| 6168 lastParameter = p; | 6184 lastParameter = p; |
| 6169 } | 6185 } |
| 6170 } | 6186 } |
| 6171 return true; | 6187 return true; |
| 6172 } | 6188 } |
| 6173 MethodMember.prototype.needsArgumentConversion = function(args) { | 6189 MethodMember.prototype.needsArgumentConversion = function(args) { |
| 6174 var bareCount = args.get$bareCount(); | 6190 var bareCount = args.get$bareCount(); |
| 6175 for (var i = (0); | 6191 for (var i = (0); |
| 6176 i < bareCount; i++) { | 6192 i < bareCount; i++) { |
| 6177 var arg = args.values[i]; | 6193 var arg = args.values.$index(i); |
| 6178 if (arg.needsConversion$1(this.parameters[i].get$type())) { | 6194 if (arg.needsConversion$1(this.parameters.$index(i).get$type())) { |
| 6179 return true; | 6195 return true; |
| 6180 } | 6196 } |
| 6181 } | 6197 } |
| 6182 if (bareCount < this.parameters.get$length()) { | 6198 if (bareCount < this.parameters.get$length()) { |
| 6183 this.genParameterValues(); | 6199 this.genParameterValues(); |
| 6184 for (var i = bareCount; | 6200 for (var i = bareCount; |
| 6185 i < this.parameters.get$length(); i++) { | 6201 i < this.parameters.get$length(); i++) { |
| 6186 var arg = args.getValue(this.parameters[i].get$name()); | 6202 var arg = args.getValue(this.parameters.$index(i).get$name()); |
| 6187 if (arg != null && arg.needsConversion$1(this.parameters[i].get$type())) { | 6203 if (arg != null && arg.needsConversion$1(this.parameters.$index(i).get$typ
e())) { |
| 6188 return true; | 6204 return true; |
| 6189 } | 6205 } |
| 6190 } | 6206 } |
| 6191 } | 6207 } |
| 6192 return false; | 6208 return false; |
| 6193 } | 6209 } |
| 6194 MethodMember._argCountMsg = function(actual, expected, atLeast) { | 6210 MethodMember._argCountMsg = function(actual, expected, atLeast) { |
| 6195 return "wrong number of positional arguments, expected " + ("" + (atLeast ? "a
t least " : "") + expected + " but found " + actual); | 6211 return "wrong number of positional arguments, expected " + ("" + (atLeast ? "a
t least " : "") + expected + " but found " + actual); |
| 6196 } | 6212 } |
| 6197 MethodMember.prototype._argError = function(context, node, target, args, msg, ar
gIndex) { | 6213 MethodMember.prototype._argError = function(context, node, target, args, msg, ar
gIndex) { |
| 6198 var span; | 6214 var span; |
| 6199 if ((args.nodes == null) || (argIndex >= args.nodes.get$length())) { | 6215 if ((args.nodes == null) || (argIndex >= args.nodes.get$length())) { |
| 6200 span = node.span; | 6216 span = node.span; |
| 6201 } | 6217 } |
| 6202 else { | 6218 else { |
| 6203 span = args.nodes[argIndex].get$span(); | 6219 span = args.nodes.$index(argIndex).get$span(); |
| 6204 } | 6220 } |
| 6205 if (this.isStatic || this.get$isConstructor()) { | 6221 if (this.isStatic || this.get$isConstructor()) { |
| 6206 $globals.world.error(msg, span); | 6222 $globals.world.error(msg, span); |
| 6207 } | 6223 } |
| 6208 else { | 6224 else { |
| 6209 $globals.world.warning(msg, span); | 6225 $globals.world.warning(msg, span); |
| 6210 } | 6226 } |
| 6211 return target.invokeNoSuchMethod(context, this.name, node, args); | 6227 return target.invokeNoSuchMethod(context, this.name, node, args); |
| 6212 } | 6228 } |
| 6213 MethodMember.prototype.genParameterValues = function() { | 6229 MethodMember.prototype.genParameterValues = function() { |
| 6214 var $$list = this.parameters; | 6230 var $$list = this.parameters; |
| 6215 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6231 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6216 var p = $$list[$$i]; | 6232 var p = $$list.$index($$i); |
| 6217 p.genValue$2(this, this.generator); | 6233 p.genValue$2(this, this.generator); |
| 6218 } | 6234 } |
| 6219 } | 6235 } |
| 6220 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
{ | 6236 MethodMember.prototype.invoke = function(context, node, target, args, isDynamic)
{ |
| 6221 if (this.parameters == null) { | 6237 if (this.parameters == null) { |
| 6222 $globals.world.info(("surprised to need to resolve: " + this.declaringType.n
ame + "." + this.name)); | 6238 $globals.world.info(("surprised to need to resolve: " + this.declaringType.n
ame + "." + this.name)); |
| 6223 this.resolve(); | 6239 this.resolve(); |
| 6224 } | 6240 } |
| 6225 this.declaringType.genMethod(this); | 6241 this.declaringType.genMethod(this); |
| 6226 if (this.isStatic || this.isFactory) { | 6242 if (this.isStatic || this.isFactory) { |
| 6227 this.declaringType.markUsed(); | 6243 this.declaringType.markUsed(); |
| 6228 } | 6244 } |
| 6229 if (this.get$isNative() && this.returnType != null) this.returnType.markUsed()
; | 6245 if (this.get$isNative() && this.returnType != null) this.returnType.markUsed()
; |
| 6230 if (!this.namesInOrder(args)) { | 6246 if (!this.namesInOrder(args)) { |
| 6231 return context.findMembers(this.name).invokeOnVar(context, node, target, arg
s); | 6247 return context.findMembers(this.name).invokeOnVar(context, node, target, arg
s); |
| 6232 } | 6248 } |
| 6233 var argsCode = []; | 6249 var argsCode = []; |
| 6234 if (!target.get$isType() && (this.get$isConstructor() || target.get$isSuper())
) { | 6250 if (!target.get$isType() && (this.get$isConstructor() || target.get$isSuper())
) { |
| 6235 argsCode.add$1("this"); | 6251 argsCode.add$1("this"); |
| 6236 } | 6252 } |
| 6237 var bareCount = args.get$bareCount(); | 6253 var bareCount = args.get$bareCount(); |
| 6238 for (var i = (0); | 6254 for (var i = (0); |
| 6239 i < bareCount; i++) { | 6255 i < bareCount; i++) { |
| 6240 var arg = args.values[i]; | 6256 var arg = args.values.$index(i); |
| 6241 if (i >= this.parameters.get$length()) { | 6257 if (i >= this.parameters.get$length()) { |
| 6242 var msg = MethodMember._argCountMsg(args.get$length(), this.parameters.get
$length(), false); | 6258 var msg = MethodMember._argCountMsg(args.get$length(), this.parameters.get
$length(), false); |
| 6243 return this._argError(context, node, target, args, msg, i); | 6259 return this._argError(context, node, target, args, msg, i); |
| 6244 } | 6260 } |
| 6245 arg = arg.convertTo$3(context, this.parameters[i].get$type(), isDynamic); | 6261 arg = arg.convertTo$3(context, this.parameters.$index(i).get$type(), isDynam
ic); |
| 6246 argsCode.add$1(arg.get$code()); | 6262 argsCode.add$1(arg.get$code()); |
| 6247 } | 6263 } |
| 6248 var namedArgsUsed = (0); | 6264 var namedArgsUsed = (0); |
| 6249 if (bareCount < this.parameters.get$length()) { | 6265 if (bareCount < this.parameters.get$length()) { |
| 6250 this.genParameterValues(); | 6266 this.genParameterValues(); |
| 6251 for (var i = bareCount; | 6267 for (var i = bareCount; |
| 6252 i < this.parameters.get$length(); i++) { | 6268 i < this.parameters.get$length(); i++) { |
| 6253 var arg = args.getValue(this.parameters[i].get$name()); | 6269 var arg = args.getValue(this.parameters.$index(i).get$name()); |
| 6254 if (arg == null) { | 6270 if (arg == null) { |
| 6255 arg = this.parameters[i].get$value(); | 6271 arg = this.parameters.$index(i).get$value(); |
| 6256 } | 6272 } |
| 6257 else { | 6273 else { |
| 6258 arg = arg.convertTo$3(context, this.parameters[i].get$type(), isDynamic)
; | 6274 arg = arg.convertTo$3(context, this.parameters.$index(i).get$type(), isD
ynamic); |
| 6259 namedArgsUsed++; | 6275 namedArgsUsed++; |
| 6260 } | 6276 } |
| 6261 if (arg == null || !this.parameters[i].get$isOptional()) { | 6277 if (arg == null || !this.parameters.$index(i).get$isOptional()) { |
| 6262 var msg = MethodMember._argCountMsg(Math.min(i, args.get$length()), $add
(i, (1)), true); | 6278 var msg = MethodMember._argCountMsg(Math.min(i, args.get$length()), i +
(1), true); |
| 6263 return this._argError(context, node, target, args, msg, i); | 6279 return this._argError(context, node, target, args, msg, i); |
| 6264 } | 6280 } |
| 6265 else { | 6281 else { |
| 6266 argsCode.add$1(arg.get$code()); | 6282 argsCode.add$1(arg.get$code()); |
| 6267 } | 6283 } |
| 6268 } | 6284 } |
| 6269 Arguments.removeTrailingNulls(argsCode); | 6285 Arguments.removeTrailingNulls(argsCode); |
| 6270 } | 6286 } |
| 6271 if (namedArgsUsed < args.get$nameCount()) { | 6287 if (namedArgsUsed < args.get$nameCount()) { |
| 6272 var seen = new HashSetImplementation(); | 6288 var seen = new HashSetImplementation(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6407 return new Value(this.get$inferredResult(), ("" + target.get$code() + "." + th
is.get$jsname() + "(" + argsString + ")"), node.span); | 6423 return new Value(this.get$inferredResult(), ("" + target.get$code() + "." + th
is.get$jsname() + "(" + argsString + ")"), node.span); |
| 6408 } | 6424 } |
| 6409 MethodMember.prototype.resolve = function() { | 6425 MethodMember.prototype.resolve = function() { |
| 6410 this.isStatic = this.declaringType.get$isTop(); | 6426 this.isStatic = this.declaringType.get$isTop(); |
| 6411 this.isConst = false; | 6427 this.isConst = false; |
| 6412 this.isFactory = false; | 6428 this.isFactory = false; |
| 6413 this.isAbstract = !this.declaringType.get$isClass(); | 6429 this.isAbstract = !this.declaringType.get$isClass(); |
| 6414 if (this.definition.modifiers != null) { | 6430 if (this.definition.modifiers != null) { |
| 6415 var $$list = this.definition.modifiers; | 6431 var $$list = this.definition.modifiers; |
| 6416 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6432 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6417 var mod = $$list[$$i]; | 6433 var mod = $$list.$index($$i); |
| 6418 if ($eq(mod.get$kind(), (85))) { | 6434 if ($eq(mod.get$kind(), (85))) { |
| 6419 if (this.isStatic) { | 6435 if (this.isStatic) { |
| 6420 $globals.world.error("duplicate static modifier", mod.get$span()); | 6436 $globals.world.error("duplicate static modifier", mod.get$span()); |
| 6421 } | 6437 } |
| 6422 this.isStatic = true; | 6438 this.isStatic = true; |
| 6423 } | 6439 } |
| 6424 else if (this.get$isConstructor() && $eq(mod.get$kind(), (92))) { | 6440 else if (this.get$isConstructor() && $eq(mod.get$kind(), (92))) { |
| 6425 if (this.isConst) { | 6441 if (this.isConst) { |
| 6426 $globals.world.error("duplicate const modifier", mod.get$span()); | 6442 $globals.world.error("duplicate const modifier", mod.get$span()); |
| 6427 } | 6443 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6479 } | 6495 } |
| 6480 if (this.get$isConstructor() && !this.isFactory) { | 6496 if (this.get$isConstructor() && !this.isFactory) { |
| 6481 this.returnType = this.declaringType; | 6497 this.returnType = this.declaringType; |
| 6482 } | 6498 } |
| 6483 else { | 6499 else { |
| 6484 this.returnType = this.resolveType(this.definition.returnType, false, true); | 6500 this.returnType = this.resolveType(this.definition.returnType, false, true); |
| 6485 } | 6501 } |
| 6486 this.parameters = []; | 6502 this.parameters = []; |
| 6487 var $$list = this.definition.formals; | 6503 var $$list = this.definition.formals; |
| 6488 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6504 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6489 var formal = $$list[$$i]; | 6505 var formal = $$list.$index($$i); |
| 6490 var param = new Parameter(formal, this); | 6506 var param = new Parameter(formal, this); |
| 6491 param.resolve$0(); | 6507 param.resolve$0(); |
| 6492 this.parameters.add(param); | 6508 this.parameters.add(param); |
| 6493 } | 6509 } |
| 6494 if (!this.isLambda) { | 6510 if (!this.isLambda) { |
| 6495 this.get$library()._addMember(this); | 6511 this.get$library()._addMember(this); |
| 6496 } | 6512 } |
| 6497 } | 6513 } |
| 6498 MethodMember.prototype.resolveType = function(node, typeErrors, allowVoid) { | 6514 MethodMember.prototype.resolveType = function(node, typeErrors, allowVoid) { |
| 6499 var t = Element.prototype.resolveType.call(this, node, typeErrors); | 6515 var t = Element.prototype.resolveType.call(this, node, typeErrors); |
| 6500 if (this.isStatic && !this.isFactory && (t instanceof ParameterType)) { | 6516 if (this.isStatic && !this.isFactory && (t instanceof ParameterType)) { |
| 6501 $globals.world.error("using type parameter in static context.", node.span); | 6517 $globals.world.error("using type parameter in static context.", node.span); |
| 6502 } | 6518 } |
| 6503 if (!allowVoid && t.get$isVoid()) { | 6519 if (!allowVoid && t.get$isVoid()) { |
| 6504 $globals.world.error("\"void\" only allowed as return type", node.span); | 6520 $globals.world.error("\"void\" only allowed as return type", node.span); |
| 6505 } | 6521 } |
| 6506 return t; | 6522 return t; |
| 6507 } | 6523 } |
| 6508 MethodMember.prototype._evalConstConstructor$2 = MethodMember.prototype._evalCon
stConstructor; | 6524 MethodMember.prototype._evalConstConstructor$2 = MethodMember.prototype._evalCon
stConstructor; |
| 6509 MethodMember.prototype._get$3 = function($0, $1, $2) { | 6525 MethodMember.prototype._get$3 = function($0, $1, $2) { |
| 6510 return this._get($0, $1, $2, false); | 6526 return this._get($0, $1, $2, false); |
| 6511 }; | 6527 }; |
| 6512 MethodMember.prototype._get$3$isDynamic = MethodMember.prototype._get; | 6528 MethodMember.prototype._get$3$isDynamic = MethodMember.prototype._get; |
| 6513 MethodMember.prototype._get$4 = MethodMember.prototype._get; | 6529 MethodMember.prototype._get$4 = MethodMember.prototype._get; |
| 6530 MethodMember.prototype._set$4 = function($0, $1, $2, $3) { |
| 6531 return this._set($0, $1, $2, $3, false); |
| 6532 }; |
| 6514 MethodMember.prototype._set$4$isDynamic = MethodMember.prototype._set; | 6533 MethodMember.prototype._set$4$isDynamic = MethodMember.prototype._set; |
| 6515 MethodMember.prototype._set$5 = MethodMember.prototype._set; | 6534 MethodMember.prototype._set$5 = MethodMember.prototype._set; |
| 6516 MethodMember.prototype.canInvoke$2 = MethodMember.prototype.canInvoke; | 6535 MethodMember.prototype.canInvoke$2 = MethodMember.prototype.canInvoke; |
| 6517 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { | 6536 MethodMember.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6518 return this.invoke($0, $1, $2, $3, false); | 6537 return this.invoke($0, $1, $2, $3, false); |
| 6519 }; | 6538 }; |
| 6520 MethodMember.prototype.invoke$4$isDynamic = MethodMember.prototype.invoke; | 6539 MethodMember.prototype.invoke$4$isDynamic = MethodMember.prototype.invoke; |
| 6521 MethodMember.prototype.invoke$5 = MethodMember.prototype.invoke; | 6540 MethodMember.prototype.invoke$5 = MethodMember.prototype.invoke; |
| 6522 MethodMember.prototype.namesInOrder$1 = MethodMember.prototype.namesInOrder; | 6541 MethodMember.prototype.namesInOrder$1 = MethodMember.prototype.namesInOrder; |
| 6523 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel
dSyntax; | 6542 MethodMember.prototype.provideFieldSyntax$0 = MethodMember.prototype.provideFiel
dSyntax; |
| 6524 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP
ropertySyntax; | 6543 MethodMember.prototype.providePropertySyntax$0 = MethodMember.prototype.provideP
ropertySyntax; |
| 6525 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; | 6544 MethodMember.prototype.resolve$0 = MethodMember.prototype.resolve; |
| 6526 MethodMember.prototype.resolveType$2 = function($0, $1) { | 6545 MethodMember.prototype.resolveType$2 = function($0, $1) { |
| 6527 return this.resolveType($0, $1, false); | 6546 return this.resolveType($0, $1, false); |
| 6528 }; | 6547 }; |
| 6529 // ********** Code for MemberSet ************** | 6548 // ********** Code for MemberSet ************** |
| 6530 function MemberSet(member, isVar) { | 6549 function MemberSet(member, isVar) { |
| 6531 this.jsname = member.get$jsname(); | 6550 this.jsname = member.get$jsname(); |
| 6532 this.name = member.name; | 6551 this.name = member.name; |
| 6533 this.isVar = isVar; | 6552 this.isVar = isVar; |
| 6534 this.members = [member]; | 6553 this.members = [member]; |
| 6535 } | 6554 } |
| 6536 MemberSet.prototype.get$name = function() { return this.name; }; | 6555 MemberSet.prototype.get$name = function() { return this.name; }; |
| 6537 MemberSet.prototype.get$members = function() { return this.members; }; | 6556 MemberSet.prototype.get$members = function() { return this.members; }; |
| 6538 MemberSet.prototype.get$jsname = function() { return this.jsname; }; | 6557 MemberSet.prototype.get$jsname = function() { return this.jsname; }; |
| 6539 MemberSet.prototype.get$isVar = function() { return this.isVar; }; | 6558 MemberSet.prototype.get$isVar = function() { return this.isVar; }; |
| 6540 MemberSet.prototype.toString = function() { | 6559 MemberSet.prototype.toString = function() { |
| 6541 return ("" + this.name + ":" + this.members.get$length()); | 6560 return ("" + this.name + ":" + this.members.get$length()); |
| 6542 } | 6561 } |
| 6562 MemberSet.prototype.get$containsMethods = function() { |
| 6563 return this.members.some((function (m) { |
| 6564 return (m instanceof MethodMember); |
| 6565 }) |
| 6566 ); |
| 6567 } |
| 6543 MemberSet.prototype.add = function(member) { | 6568 MemberSet.prototype.add = function(member) { |
| 6544 return this.members.add(member); | 6569 return this.members.add(member); |
| 6545 } | 6570 } |
| 6546 MemberSet.prototype.get$isStatic = function() { | 6571 MemberSet.prototype.get$isStatic = function() { |
| 6547 return this.members.get$length() == (1) && this.members[(0)].get$isStatic(); | 6572 return this.members.get$length() == (1) && this.members.$index((0)).get$isStat
ic(); |
| 6548 } | 6573 } |
| 6549 MemberSet.prototype.get$isOperator = function() { | 6574 MemberSet.prototype.get$isOperator = function() { |
| 6550 return this.members[(0)].get$isOperator(); | 6575 return this.members.$index((0)).get$isOperator(); |
| 6551 } | 6576 } |
| 6552 MemberSet.prototype.canInvoke = function(context, args) { | 6577 MemberSet.prototype.canInvoke = function(context, args) { |
| 6553 return this.members.some((function (m) { | 6578 return this.members.some((function (m) { |
| 6554 return m.canInvoke$2(context, args); | 6579 return m.canInvoke$2(context, args); |
| 6555 }) | 6580 }) |
| 6556 ); | 6581 ); |
| 6557 } | 6582 } |
| 6558 MemberSet.prototype._makeError = function(node, target, action) { | 6583 MemberSet.prototype._makeError = function(node, target, action) { |
| 6559 if (!target.get$type().get$isVar()) { | 6584 if (!target.get$type().get$isVar()) { |
| 6560 $globals.world.warning(("could not find applicable " + action + " for \"" +
this.name + "\""), node.span); | 6585 $globals.world.warning(("could not find applicable " + action + " for \"" +
this.name + "\""), node.span); |
| 6561 } | 6586 } |
| 6562 return new Value($globals.world.varType, ("" + target.get$code() + "." + this.
jsname + "() /*no applicable " + action + "*/"), node.span); | 6587 return new Value($globals.world.varType, ("" + target.get$code() + "." + this.
jsname + "() /*no applicable " + action + "*/"), node.span); |
| 6563 } | 6588 } |
| 6564 MemberSet.prototype.get$treatAsField = function() { | 6589 MemberSet.prototype.get$treatAsField = function() { |
| 6565 if (this._treatAsField == null) { | 6590 if (this._treatAsField == null) { |
| 6566 this._treatAsField = !this.isVar && (this.members.some((function (m) { | 6591 this._treatAsField = !this.isVar && (this.members.some((function (m) { |
| 6567 return m.get$requiresFieldSyntax(); | 6592 return m.get$requiresFieldSyntax(); |
| 6568 }) | 6593 }) |
| 6569 ) || this.members.every((function (m) { | 6594 ) || this.members.every((function (m) { |
| 6570 return !m.get$requiresPropertySyntax(); | 6595 return !m.get$requiresPropertySyntax(); |
| 6571 }) | 6596 }) |
| 6572 )); | 6597 )); |
| 6573 var $$list = this.members; | 6598 var $$list = this.members; |
| 6574 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 6599 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 6575 var member = $$list[$$i]; | 6600 var member = $$list.$index($$i); |
| 6576 if (this._treatAsField) { | 6601 if (this._treatAsField) { |
| 6577 member.provideFieldSyntax$0(); | 6602 member.provideFieldSyntax$0(); |
| 6578 } | 6603 } |
| 6579 else { | 6604 else { |
| 6580 member.providePropertySyntax$0(); | 6605 member.providePropertySyntax$0(); |
| 6581 } | 6606 } |
| 6582 } | 6607 } |
| 6583 } | 6608 } |
| 6584 return this._treatAsField; | 6609 return this._treatAsField; |
| 6585 } | 6610 } |
| 6586 MemberSet.prototype._get = function(context, node, target, isDynamic) { | 6611 MemberSet.prototype._get = function(context, node, target, isDynamic) { |
| 6587 var returnValue; | 6612 var returnValue; |
| 6588 if (this.members.get$length() == (1) && !this.isVar) { | |
| 6589 return this.members[(0)]._get$4(context, node, target, isDynamic); | |
| 6590 } | |
| 6591 var targets = this.members.filter$1((function (m) { | 6613 var targets = this.members.filter$1((function (m) { |
| 6592 return m.get$canGet(); | 6614 return m.get$canGet(); |
| 6593 }) | 6615 }) |
| 6594 ); | 6616 ); |
| 6595 if (this.isVar) { | 6617 if (this.isVar) { |
| 6596 targets.forEach$1((function (m) { | 6618 targets.forEach$1((function (m) { |
| 6597 return m._get$3$isDynamic(context, node, target, true); | 6619 return m._get$3$isDynamic(context, node, target, true); |
| 6598 }) | 6620 }) |
| 6599 ); | 6621 ); |
| 6600 returnValue = new Value(this._foldTypes(targets), null, node.span); | 6622 returnValue = new Value(this._foldTypes(targets), null, node.span); |
| 6601 } | 6623 } |
| 6602 else { | 6624 else { |
| 6603 if (this.members.get$length() == (1)) { | 6625 if (this.members.get$length() == (1)) { |
| 6604 return this.members[(0)]._get$4(context, node, target, isDynamic); | 6626 return this.members.$index((0))._get$4(context, node, target, isDynamic); |
| 6605 } | 6627 } |
| 6606 else if ($eq(targets.get$length(), (1))) { | 6628 else if ($eq(targets.get$length(), (1))) { |
| 6607 return targets.$index((0))._get$4(context, node, target, isDynamic); | 6629 return targets.$index((0))._get$4(context, node, target, isDynamic); |
| 6608 } | 6630 } |
| 6609 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6631 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6610 var member = $$i.next$0(); | 6632 var member = $$i.next$0(); |
| 6611 var value = member._get$3$isDynamic(context, node, target, true); | 6633 var value = member._get$3$isDynamic(context, node, target, true); |
| 6612 returnValue = this._tryUnion(returnValue, value, node); | 6634 returnValue = this._tryUnion(returnValue, value, node); |
| 6613 } | 6635 } |
| 6614 if (returnValue == null) { | 6636 if (returnValue == null) { |
| 6615 return this._makeError(node, target, "getter"); | 6637 return this._makeError(node, target, "getter"); |
| 6616 } | 6638 } |
| 6617 } | 6639 } |
| 6618 if (returnValue.get$code() == null) { | 6640 if (returnValue.get$code() == null) { |
| 6619 if (this.get$treatAsField()) { | 6641 if (this.get$treatAsField()) { |
| 6620 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t
his.jsname), node.span); | 6642 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t
his.jsname), node.span); |
| 6621 } | 6643 } |
| 6622 else { | 6644 else { |
| 6623 return new Value(returnValue.get$type(), ("" + target.get$code() + ".get$"
+ this.jsname + "()"), node.span); | 6645 return new Value(returnValue.get$type(), ("" + target.get$code() + ".get$"
+ this.jsname + "()"), node.span); |
| 6624 } | 6646 } |
| 6625 } | 6647 } |
| 6626 return returnValue; | 6648 return returnValue; |
| 6627 } | 6649 } |
| 6628 MemberSet.prototype._set = function(context, node, target, value, isDynamic) { | 6650 MemberSet.prototype._set = function(context, node, target, value, isDynamic) { |
| 6629 if (this.members.get$length() == (1) && !this.isVar) { | |
| 6630 return this.members[(0)]._set$5(context, node, target, value, isDynamic); | |
| 6631 } | |
| 6632 var returnValue; | 6651 var returnValue; |
| 6633 var targets = this.members.filter$1((function (m) { | 6652 var targets = this.members.filter$1((function (m) { |
| 6634 return m.get$canSet(); | 6653 return m.get$canSet(); |
| 6635 }) | 6654 }) |
| 6636 ); | 6655 ); |
| 6637 if (this.isVar) { | 6656 if (this.isVar) { |
| 6638 targets.forEach$1((function (m) { | 6657 targets.forEach$1((function (m) { |
| 6639 return m._set$4$isDynamic(context, node, target, value, true); | 6658 return m._set$4$isDynamic(context, node, target, value, true); |
| 6640 }) | 6659 }) |
| 6641 ); | 6660 ); |
| 6642 returnValue = new Value(this._foldTypes(targets), null, node.span); | 6661 returnValue = new Value(this._foldTypes(targets), null, node.span); |
| 6643 } | 6662 } |
| 6644 else { | 6663 else { |
| 6645 if (this.members.get$length() == (1)) { | 6664 if (this.members.get$length() == (1)) { |
| 6646 return this.members[(0)]._set$5(context, node, target, value, isDynamic); | 6665 return this.members.$index((0))._set$5(context, node, target, value, isDyn
amic); |
| 6647 } | 6666 } |
| 6648 else if ($eq(targets.get$length(), (1))) { | 6667 else if ($eq(targets.get$length(), (1))) { |
| 6649 return targets.$index((0))._set$5(context, node, target, value, isDynamic)
; | 6668 return targets.$index((0))._set$5(context, node, target, value, isDynamic)
; |
| 6650 } | 6669 } |
| 6651 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6670 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6652 var member = $$i.next$0(); | 6671 var member = $$i.next$0(); |
| 6653 var res = member._set$4$isDynamic(context, node, target, value, true); | 6672 var res = member._set$4$isDynamic(context, node, target, value, true); |
| 6654 returnValue = this._tryUnion(returnValue, res, node); | 6673 returnValue = this._tryUnion(returnValue, res, node); |
| 6655 } | 6674 } |
| 6656 if (returnValue == null) { | 6675 if (returnValue == null) { |
| 6657 return this._makeError(node, target, "setter"); | 6676 return this._makeError(node, target, "setter"); |
| 6658 } | 6677 } |
| 6659 } | 6678 } |
| 6660 if (returnValue.get$code() == null) { | 6679 if (returnValue.get$code() == null) { |
| 6661 if (this.get$treatAsField()) { | 6680 if (this.get$treatAsField()) { |
| 6662 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t
his.jsname + " = " + value.get$code()), node.span); | 6681 return new Value(returnValue.get$type(), ("" + target.get$code() + "." + t
his.jsname + " = " + value.get$code()), node.span); |
| 6663 } | 6682 } |
| 6664 else { | 6683 else { |
| 6665 return new Value(returnValue.get$type(), ("" + target.get$code() + ".set$"
+ this.jsname + "(" + value.get$code() + ")"), node.span); | 6684 return new Value(returnValue.get$type(), ("" + target.get$code() + ".set$"
+ this.jsname + "(" + value.get$code() + ")"), node.span); |
| 6666 } | 6685 } |
| 6667 } | 6686 } |
| 6668 return returnValue; | 6687 return returnValue; |
| 6669 } | 6688 } |
| 6670 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { | 6689 MemberSet.prototype.invoke = function(context, node, target, args, isDynamic) { |
| 6671 if (this.isVar && !this.get$isOperator()) { | 6690 if (this.isVar && !this.get$isOperator()) { |
| 6672 return this.invokeOnVar(context, node, target, args); | 6691 return this.invokeOnVar(context, node, target, args); |
| 6673 } | 6692 } |
| 6674 if (this.members.get$length() == (1) && !this.isVar) { | 6693 if (this.members.get$length() == (1)) { |
| 6675 return this.members[(0)].invoke$5(context, node, target, args, isDynamic); | 6694 return this.members.$index((0)).invoke$5(context, node, target, args, isDyna
mic); |
| 6676 } | 6695 } |
| 6677 var targets = this.members.filter$1((function (m) { | 6696 var targets = this.members.filter$1((function (m) { |
| 6678 return m.canInvoke$2(context, args); | 6697 return m.canInvoke$2(context, args); |
| 6679 }) | 6698 }) |
| 6680 ); | 6699 ); |
| 6681 if ($eq(targets.get$length(), (1))) { | 6700 if ($eq(targets.get$length(), (1))) { |
| 6682 return targets.$index((0)).invoke$5(context, node, target, args, isDynamic); | 6701 return targets.$index((0)).invoke$5(context, node, target, args, isDynamic); |
| 6683 } | 6702 } |
| 6684 var returnValue = null; | 6703 var returnValue = null; |
| 6685 if (targets.get$length() < (1000)) { | 6704 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { |
| 6686 for (var $$i = targets.iterator$0(); $$i.hasNext$0(); ) { | 6705 var member = $$i.next$0(); |
| 6687 var member = $$i.next$0(); | 6706 var res = member.invoke$4$isDynamic(context, node, target, args, true); |
| 6688 var res = member.invoke$4$isDynamic(context, node, target, args, true); | 6707 returnValue = this._tryUnion(returnValue, res, node); |
| 6689 returnValue = this._tryUnion(returnValue, res, node); | |
| 6690 } | |
| 6691 if (returnValue == null) { | |
| 6692 return this._makeError(node, target, "method"); | |
| 6693 } | |
| 6694 } | 6708 } |
| 6695 else { | 6709 if (returnValue == null) { |
| 6696 returnValue = new Value($globals.world.varType, null, node.span); | 6710 return this._makeError(node, target, "method"); |
| 6697 } | 6711 } |
| 6698 if (returnValue.get$code() == null) { | 6712 if (returnValue.get$code() == null) { |
| 6699 if (this.name == ":call") { | 6713 if (this.name == ":call") { |
| 6700 return target._varCall(context, node, args); | 6714 return target._varCall(context, node, args); |
| 6701 } | 6715 } |
| 6702 else if (this.get$isOperator()) { | 6716 else if (this.get$isOperator()) { |
| 6703 return this.invokeSpecial(target, args, returnValue.get$type()); | 6717 return this.invokeSpecial(target, args, returnValue.get$type()); |
| 6704 } | 6718 } |
| 6705 else { | 6719 else { |
| 6706 return this.invokeOnVar(context, node, target, args); | 6720 return this.invokeOnVar(context, node, target, args); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6763 return reduce(map(targets, (function (t) { | 6777 return reduce(map(targets, (function (t) { |
| 6764 return t.get$returnType(); | 6778 return t.get$returnType(); |
| 6765 }) | 6779 }) |
| 6766 ), Type.union, $globals.world.varType); | 6780 ), Type.union, $globals.world.varType); |
| 6767 } | 6781 } |
| 6768 MemberSet.prototype._get$3 = function($0, $1, $2) { | 6782 MemberSet.prototype._get$3 = function($0, $1, $2) { |
| 6769 return this._get($0, $1, $2, false); | 6783 return this._get($0, $1, $2, false); |
| 6770 }; | 6784 }; |
| 6771 MemberSet.prototype._get$3$isDynamic = MemberSet.prototype._get; | 6785 MemberSet.prototype._get$3$isDynamic = MemberSet.prototype._get; |
| 6772 MemberSet.prototype._get$4 = MemberSet.prototype._get; | 6786 MemberSet.prototype._get$4 = MemberSet.prototype._get; |
| 6787 MemberSet.prototype._set$4 = function($0, $1, $2, $3) { |
| 6788 return this._set($0, $1, $2, $3, false); |
| 6789 }; |
| 6773 MemberSet.prototype._set$4$isDynamic = MemberSet.prototype._set; | 6790 MemberSet.prototype._set$4$isDynamic = MemberSet.prototype._set; |
| 6774 MemberSet.prototype._set$5 = MemberSet.prototype._set; | 6791 MemberSet.prototype._set$5 = MemberSet.prototype._set; |
| 6775 MemberSet.prototype.add$1 = MemberSet.prototype.add; | 6792 MemberSet.prototype.add$1 = MemberSet.prototype.add; |
| 6776 MemberSet.prototype.canInvoke$2 = MemberSet.prototype.canInvoke; | 6793 MemberSet.prototype.canInvoke$2 = MemberSet.prototype.canInvoke; |
| 6777 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { | 6794 MemberSet.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 6778 return this.invoke($0, $1, $2, $3, false); | 6795 return this.invoke($0, $1, $2, $3, false); |
| 6779 }; | 6796 }; |
| 6780 MemberSet.prototype.invoke$4$isDynamic = MemberSet.prototype.invoke; | 6797 MemberSet.prototype.invoke$4$isDynamic = MemberSet.prototype.invoke; |
| 6781 MemberSet.prototype.invoke$5 = MemberSet.prototype.invoke; | 6798 MemberSet.prototype.invoke$5 = MemberSet.prototype.invoke; |
| 6782 MemberSet.prototype.toString$0 = MemberSet.prototype.toString; | 6799 MemberSet.prototype.toString$0 = MemberSet.prototype.toString; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 6794 } | 6811 } |
| 6795 FactoryMap.prototype.addFactory = function(typeName, name, member) { | 6812 FactoryMap.prototype.addFactory = function(typeName, name, member) { |
| 6796 this.getFactoriesFor(typeName).$setindex(name, member); | 6813 this.getFactoriesFor(typeName).$setindex(name, member); |
| 6797 } | 6814 } |
| 6798 FactoryMap.prototype.getFactory = function(typeName, name) { | 6815 FactoryMap.prototype.getFactory = function(typeName, name) { |
| 6799 return this.getFactoriesFor(typeName).$index(name); | 6816 return this.getFactoriesFor(typeName).$index(name); |
| 6800 } | 6817 } |
| 6801 FactoryMap.prototype.forEach = function(f) { | 6818 FactoryMap.prototype.forEach = function(f) { |
| 6802 this.factories.forEach((function (_, constructors) { | 6819 this.factories.forEach((function (_, constructors) { |
| 6803 constructors.forEach((function (_, member) { | 6820 constructors.forEach((function (_, member) { |
| 6804 f.call$1(member); | 6821 f(member); |
| 6805 }) | 6822 }) |
| 6806 ); | 6823 ); |
| 6807 }) | 6824 }) |
| 6808 ); | 6825 ); |
| 6809 } | 6826 } |
| 6810 FactoryMap.prototype.forEach$1 = function($0) { | 6827 FactoryMap.prototype.forEach$1 = function($0) { |
| 6811 return this.forEach(to$call$1($0)); | 6828 return this.forEach(to$call$1($0)); |
| 6812 }; | 6829 }; |
| 6813 FactoryMap.prototype.getFactory$2 = FactoryMap.prototype.getFactory; | 6830 FactoryMap.prototype.getFactory$2 = FactoryMap.prototype.getFactory; |
| 6814 // ********** Code for Token ************** | 6831 // ********** Code for Token ************** |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6872 SourceFile.prototype.get$orderInLibrary = function() { return this.orderInLibrar
y; }; | 6889 SourceFile.prototype.get$orderInLibrary = function() { return this.orderInLibrar
y; }; |
| 6873 SourceFile.prototype.set$orderInLibrary = function(value) { return this.orderInL
ibrary = value; }; | 6890 SourceFile.prototype.set$orderInLibrary = function(value) { return this.orderInL
ibrary = value; }; |
| 6874 SourceFile.prototype.get$text = function() { | 6891 SourceFile.prototype.get$text = function() { |
| 6875 return this._text; | 6892 return this._text; |
| 6876 } | 6893 } |
| 6877 SourceFile.prototype.get$lineStarts = function() { | 6894 SourceFile.prototype.get$lineStarts = function() { |
| 6878 if (this._lineStarts == null) { | 6895 if (this._lineStarts == null) { |
| 6879 var starts = [(0)]; | 6896 var starts = [(0)]; |
| 6880 var index = (0); | 6897 var index = (0); |
| 6881 while (index < this.get$text().length) { | 6898 while (index < this.get$text().length) { |
| 6882 index = $add(this.get$text().indexOf("\n", index), (1)); | 6899 index = this.get$text().indexOf("\n", index) + (1); |
| 6883 if (index <= (0)) break; | 6900 if (index <= (0)) break; |
| 6884 starts.add$1(index); | 6901 starts.add$1(index); |
| 6885 } | 6902 } |
| 6886 starts.add$1($add(this.get$text().length, (1))); | 6903 starts.add$1(this.get$text().length + (1)); |
| 6887 this._lineStarts = starts; | 6904 this._lineStarts = starts; |
| 6888 } | 6905 } |
| 6889 return this._lineStarts; | 6906 return this._lineStarts; |
| 6890 } | 6907 } |
| 6891 SourceFile.prototype.getLine = function(position) { | 6908 SourceFile.prototype.getLine = function(position) { |
| 6892 var starts = this.get$lineStarts(); | 6909 var starts = this.get$lineStarts(); |
| 6893 for (var i = (0); | 6910 for (var i = (0); |
| 6894 i < starts.get$length(); i++) { | 6911 i < starts.get$length(); i++) { |
| 6895 if (starts.$index(i) > position) return i - (1); | 6912 if (starts.$index(i) > position) return i - (1); |
| 6896 } | 6913 } |
| 6897 $globals.world.internalError("bad position"); | 6914 $globals.world.internalError("bad position"); |
| 6898 } | 6915 } |
| 6899 SourceFile.prototype.getColumn = function(line, position) { | 6916 SourceFile.prototype.getColumn = function(line, position) { |
| 6900 return position - this.get$lineStarts()[line]; | 6917 return position - this.get$lineStarts().$index(line); |
| 6901 } | 6918 } |
| 6902 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
ext) { | 6919 SourceFile.prototype.getLocationMessage = function(message, start, end, includeT
ext) { |
| 6903 var line = this.getLine(start); | 6920 var line = this.getLine(start); |
| 6904 var column = this.getColumn(line, start); | 6921 var column = this.getColumn(line, start); |
| 6905 var buf = new StringBufferImpl(("" + this.filename + ":" + ($add(line, (1))) +
":" + ($add(column, (1))) + ": " + message)); | 6922 var buf = new StringBufferImpl(("" + this.filename + ":" + ($add(line, (1))) +
":" + ($add(column, (1))) + ": " + message)); |
| 6906 if (includeText) { | 6923 if (includeText) { |
| 6907 buf.add$1("\n"); | 6924 buf.add$1("\n"); |
| 6908 var textLine; | 6925 var textLine; |
| 6909 if (($add(line, (2))) < this._lineStarts.get$length()) { | 6926 if (($add(line, (2))) < this._lineStarts.get$length()) { |
| 6910 textLine = this.get$text().substring(this._lineStarts[line], this._lineSta
rts[$add(line, (1))]); | 6927 textLine = this.get$text().substring(this._lineStarts.$index(line), this._
lineStarts.$index($add(line, (1)))); |
| 6911 } | 6928 } |
| 6912 else { | 6929 else { |
| 6913 textLine = this.get$text().substring(this._lineStarts[line]) + "\n"; | 6930 textLine = this.get$text().substring(this._lineStarts.$index(line)) + "\n"
; |
| 6914 } | 6931 } |
| 6915 var toColumn = Math.min($add(column, (end - start)), textLine.get$length()); | 6932 var toColumn = Math.min($add(column, (end - start)), textLine.get$length()); |
| 6916 if ($globals.options.useColors) { | 6933 if ($globals.options.useColors) { |
| 6917 buf.add$1(textLine.substring$2((0), column)); | 6934 buf.add$1(textLine.substring$2((0), column)); |
| 6918 buf.add$1($globals._RED_COLOR); | 6935 buf.add$1($globals._RED_COLOR); |
| 6919 buf.add$1(textLine.substring$2(column, toColumn)); | 6936 buf.add$1(textLine.substring$2(column, toColumn)); |
| 6920 buf.add$1($globals._NO_COLOR); | 6937 buf.add$1($globals._NO_COLOR); |
| 6921 buf.add$1(textLine.substring$1(toColumn)); | 6938 buf.add$1(textLine.substring$1(toColumn)); |
| 6922 } | 6939 } |
| 6923 else { | 6940 else { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7158 else { | 7175 else { |
| 7159 return (-1); | 7176 return (-1); |
| 7160 } | 7177 } |
| 7161 } | 7178 } |
| 7162 TokenizerBase.prototype.readHex = function(hexLength) { | 7179 TokenizerBase.prototype.readHex = function(hexLength) { |
| 7163 var maxIndex; | 7180 var maxIndex; |
| 7164 if (hexLength == null) { | 7181 if (hexLength == null) { |
| 7165 maxIndex = this._text.length - (1); | 7182 maxIndex = this._text.length - (1); |
| 7166 } | 7183 } |
| 7167 else { | 7184 else { |
| 7168 maxIndex = $add(this._lang_index, hexLength); | 7185 maxIndex = this._lang_index + hexLength; |
| 7169 if (maxIndex >= this._text.length) return (-1); | 7186 if (maxIndex >= this._text.length) return (-1); |
| 7170 } | 7187 } |
| 7171 var result = (0); | 7188 var result = (0); |
| 7172 while (this._lang_index < maxIndex) { | 7189 while (this._lang_index < maxIndex) { |
| 7173 var digit = TokenizerBase._hexDigit(this._text.charCodeAt(this._lang_index))
; | 7190 var digit = TokenizerBase._hexDigit(this._text.charCodeAt(this._lang_index))
; |
| 7174 if ($eq(digit, (-1))) { | 7191 if ($eq(digit, (-1))) { |
| 7175 if (hexLength == null) { | 7192 if (hexLength == null) { |
| 7176 return result; | 7193 return result; |
| 7177 } | 7194 } |
| 7178 else { | 7195 else { |
| 7179 return (-1); | 7196 return (-1); |
| 7180 } | 7197 } |
| 7181 } | 7198 } |
| 7182 TokenizerBase._hexDigit(this._text.charCodeAt(this._lang_index)); | 7199 TokenizerBase._hexDigit(this._text.charCodeAt(this._lang_index)); |
| 7183 result = $add((result * (16)), digit); | 7200 result = (result * (16)) + digit; |
| 7184 this._lang_index++; | 7201 this._lang_index++; |
| 7185 } | 7202 } |
| 7186 return result; | 7203 return result; |
| 7187 } | 7204 } |
| 7188 TokenizerBase.prototype.finishHex = function() { | 7205 TokenizerBase.prototype.finishHex = function() { |
| 7189 var value = this.readHex(); | 7206 var value = this.readHex(); |
| 7190 return new LiteralToken((61), this._source, this._startIndex, this._lang_index
, value); | 7207 return new LiteralToken((61), this._source, this._startIndex, this._lang_index
, value); |
| 7191 } | 7208 } |
| 7192 TokenizerBase.prototype.finishNumber = function() { | 7209 TokenizerBase.prototype.finishNumber = function() { |
| 7193 this.eatDigits(); | 7210 this.eatDigits(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 7217 return this._finishToken(kind); | 7234 return this._finishToken(kind); |
| 7218 } | 7235 } |
| 7219 TokenizerBase.prototype._makeStringToken = function(buf, isPart) { | 7236 TokenizerBase.prototype._makeStringToken = function(buf, isPart) { |
| 7220 var s = Strings.String$fromCharCodes$factory(buf); | 7237 var s = Strings.String$fromCharCodes$factory(buf); |
| 7221 var kind = isPart ? (59) : (58); | 7238 var kind = isPart ? (59) : (58); |
| 7222 return new LiteralToken(kind, this._source, this._startIndex, this._lang_index
, s); | 7239 return new LiteralToken(kind, this._source, this._startIndex, this._lang_index
, s); |
| 7223 } | 7240 } |
| 7224 TokenizerBase.prototype._makeRawStringToken = function(isMultiline) { | 7241 TokenizerBase.prototype._makeRawStringToken = function(isMultiline) { |
| 7225 var s; | 7242 var s; |
| 7226 if (isMultiline) { | 7243 if (isMultiline) { |
| 7227 var start = $add(this._startIndex, (4)); | 7244 var start = this._startIndex + (4); |
| 7228 if (this._source.get$text()[start] == "\n") start++; | 7245 if (this._source.get$text()[start] == "\n") start++; |
| 7229 s = this._source.get$text().substring(start, this._lang_index - (3)); | 7246 s = this._source.get$text().substring(start, this._lang_index - (3)); |
| 7230 } | 7247 } |
| 7231 else { | 7248 else { |
| 7232 s = this._source.get$text().substring($add(this._startIndex, (2)), this._lan
g_index - (1)); | 7249 s = this._source.get$text().substring(this._startIndex + (2), this._lang_ind
ex - (1)); |
| 7233 } | 7250 } |
| 7234 return new LiteralToken((58), this._source, this._startIndex, this._lang_index
, s); | 7251 return new LiteralToken((58), this._source, this._startIndex, this._lang_index
, s); |
| 7235 } | 7252 } |
| 7236 TokenizerBase.prototype.finishMultilineString = function(quote) { | 7253 TokenizerBase.prototype.finishMultilineString = function(quote) { |
| 7237 var buf = []; | 7254 var buf = []; |
| 7238 while (true) { | 7255 while (true) { |
| 7239 var ch = this._nextChar(); | 7256 var ch = this._nextChar(); |
| 7240 if (ch == (0)) { | 7257 if (ch == (0)) { |
| 7241 return this._errorToken(); | 7258 return this._errorToken(); |
| 7242 } | 7259 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 7267 } | 7284 } |
| 7268 } | 7285 } |
| 7269 } | 7286 } |
| 7270 TokenizerBase.prototype._finishOpenBrace = function() { | 7287 TokenizerBase.prototype._finishOpenBrace = function() { |
| 7271 var $0; | 7288 var $0; |
| 7272 if (this._interpStack != null) { | 7289 if (this._interpStack != null) { |
| 7273 if (this._interpStack.depth == (-1)) { | 7290 if (this._interpStack.depth == (-1)) { |
| 7274 this._interpStack.depth = (1); | 7291 this._interpStack.depth = (1); |
| 7275 } | 7292 } |
| 7276 else { | 7293 else { |
| 7277 ($0 = this._interpStack).depth = $add($0.depth, (1)); | 7294 ($0 = this._interpStack).depth = $0.depth + (1); |
| 7278 } | 7295 } |
| 7279 } | 7296 } |
| 7280 return this._finishToken((6)); | 7297 return this._finishToken((6)); |
| 7281 } | 7298 } |
| 7282 TokenizerBase.prototype._finishCloseBrace = function() { | 7299 TokenizerBase.prototype._finishCloseBrace = function() { |
| 7283 var $0; | 7300 var $0; |
| 7284 if (this._interpStack != null) { | 7301 if (this._interpStack != null) { |
| 7285 ($0 = this._interpStack).depth = $0.depth - (1); | 7302 ($0 = this._interpStack).depth = $0.depth - (1); |
| 7286 } | 7303 } |
| 7287 return this._finishToken((7)); | 7304 return this._finishToken((7)); |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8478 case (115): | 8495 case (115): |
| 8479 | 8496 |
| 8480 return "keyword 'void'"; | 8497 return "keyword 'void'"; |
| 8481 | 8498 |
| 8482 case (116): | 8499 case (116): |
| 8483 | 8500 |
| 8484 return "keyword 'while'"; | 8501 return "keyword 'while'"; |
| 8485 | 8502 |
| 8486 default: | 8503 default: |
| 8487 | 8504 |
| 8488 return "TokenKind(" + kind.toString$0() + ")"; | 8505 return "TokenKind(" + kind.toString() + ")"; |
| 8489 | 8506 |
| 8490 } | 8507 } |
| 8491 } | 8508 } |
| 8492 TokenKind.isIdentifier = function(kind) { | 8509 TokenKind.isIdentifier = function(kind) { |
| 8493 return kind >= (70) && kind < (87); | 8510 return kind >= (70) && kind < (87); |
| 8494 } | 8511 } |
| 8495 TokenKind.infixPrecedence = function(kind) { | 8512 TokenKind.infixPrecedence = function(kind) { |
| 8496 switch (kind) { | 8513 switch (kind) { |
| 8497 case (20): | 8514 case (20): |
| 8498 | 8515 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8816 | 8833 |
| 8817 case (57): | 8834 case (57): |
| 8818 | 8835 |
| 8819 return ":setindex"; | 8836 return ":setindex"; |
| 8820 | 8837 |
| 8821 } | 8838 } |
| 8822 } | 8839 } |
| 8823 TokenKind.kindFromAssign = function(kind) { | 8840 TokenKind.kindFromAssign = function(kind) { |
| 8824 if (kind == (20)) return (0); | 8841 if (kind == (20)) return (0); |
| 8825 if (kind > (20) && kind <= (32)) { | 8842 if (kind > (20) && kind <= (32)) { |
| 8826 return $add(kind, (15)); | 8843 return kind + (15); |
| 8827 } | 8844 } |
| 8828 return (-1); | 8845 return (-1); |
| 8829 } | 8846 } |
| 8830 // ********** Code for Parser ************** | 8847 // ********** Code for Parser ************** |
| 8831 function Parser(source, diet, throwOnIncomplete, optionalSemicolons, startOffset
) { | 8848 function Parser(source, diet, throwOnIncomplete, optionalSemicolons, startOffset
) { |
| 8832 this.throwOnIncomplete = throwOnIncomplete; | 8849 this.throwOnIncomplete = throwOnIncomplete; |
| 8833 this.source = source; | 8850 this.source = source; |
| 8834 this.optionalSemicolons = optionalSemicolons; | 8851 this.optionalSemicolons = optionalSemicolons; |
| 8835 this._recover = false; | 8852 this._recover = false; |
| 8836 this._inhibitLambda = false; | 8853 this._inhibitLambda = false; |
| (...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9887 if (this._inhibitLambda) return false; | 9904 if (this._inhibitLambda) return false; |
| 9888 var after = this._peekAfterCloseParen(); | 9905 var after = this._peekAfterCloseParen(); |
| 9889 return after.kind == (9) || after.kind == (6); | 9906 return after.kind == (9) || after.kind == (6); |
| 9890 } | 9907 } |
| 9891 Parser.prototype._eatLeftParen = function() { | 9908 Parser.prototype._eatLeftParen = function() { |
| 9892 this._eat((2)); | 9909 this._eat((2)); |
| 9893 this._afterParensIndex++; | 9910 this._afterParensIndex++; |
| 9894 } | 9911 } |
| 9895 Parser.prototype._peekAfterCloseParen = function() { | 9912 Parser.prototype._peekAfterCloseParen = function() { |
| 9896 if (this._afterParensIndex < this._afterParens.get$length()) { | 9913 if (this._afterParensIndex < this._afterParens.get$length()) { |
| 9897 return this._afterParens[this._afterParensIndex]; | 9914 return this._afterParens.$index(this._afterParensIndex); |
| 9898 } | 9915 } |
| 9899 this._afterParensIndex = (0); | 9916 this._afterParensIndex = (0); |
| 9900 this._afterParens.clear(); | 9917 this._afterParens.clear(); |
| 9901 var tokens = [this._lang_next()]; | 9918 var tokens = [this._lang_next()]; |
| 9902 this._lookaheadAfterParens(tokens); | 9919 this._lookaheadAfterParens(tokens); |
| 9903 var after = this._peekToken; | 9920 var after = this._peekToken; |
| 9904 tokens.add$1(after); | 9921 tokens.add$1(after); |
| 9905 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); | 9922 this.tokenizer = new DivertedTokenSource(tokens, this, this.tokenizer); |
| 9906 this._lang_next(); | 9923 this._lang_next(); |
| 9907 return after; | 9924 return after; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10157 return depth; | 10174 return depth; |
| 10158 } | 10175 } |
| 10159 } | 10176 } |
| 10160 Parser.prototype.addTypeArguments = function(baseType, depth) { | 10177 Parser.prototype.addTypeArguments = function(baseType, depth) { |
| 10161 this._eat((52)); | 10178 this._eat((52)); |
| 10162 return this._finishTypeArguments(baseType, depth, []); | 10179 return this._finishTypeArguments(baseType, depth, []); |
| 10163 } | 10180 } |
| 10164 Parser.prototype._finishTypeArguments = function(baseType, depth, types) { | 10181 Parser.prototype._finishTypeArguments = function(baseType, depth, types) { |
| 10165 var delta = (-1); | 10182 var delta = (-1); |
| 10166 do { | 10183 do { |
| 10167 var myType = this.type($add(depth, (1))); | 10184 var myType = this.type(depth + (1)); |
| 10168 types.add$1(myType); | 10185 types.add$1(myType); |
| 10169 if ((myType instanceof GenericTypeReference) && myType.get$depth() <= depth)
{ | 10186 if ((myType instanceof GenericTypeReference) && myType.get$depth() <= depth)
{ |
| 10170 delta = depth - myType.get$depth(); | 10187 delta = depth - myType.get$depth(); |
| 10171 break; | 10188 break; |
| 10172 } | 10189 } |
| 10173 } | 10190 } |
| 10174 while (this._maybeEat((11))) | 10191 while (this._maybeEat((11))) |
| 10175 if (delta >= (0)) { | 10192 if (delta >= (0)) { |
| 10176 depth = depth - delta; | 10193 depth = depth - delta; |
| 10177 } | 10194 } |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10358 } | 10375 } |
| 10359 IncompleteSourceException.prototype.toString$0 = IncompleteSourceException.proto
type.toString; | 10376 IncompleteSourceException.prototype.toString$0 = IncompleteSourceException.proto
type.toString; |
| 10360 // ********** Code for DivertedTokenSource ************** | 10377 // ********** Code for DivertedTokenSource ************** |
| 10361 function DivertedTokenSource(tokens, parser, previousTokenizer) { | 10378 function DivertedTokenSource(tokens, parser, previousTokenizer) { |
| 10362 this.parser = parser; | 10379 this.parser = parser; |
| 10363 this._lang_pos = (0); | 10380 this._lang_pos = (0); |
| 10364 this.tokens = tokens; | 10381 this.tokens = tokens; |
| 10365 this.previousTokenizer = previousTokenizer; | 10382 this.previousTokenizer = previousTokenizer; |
| 10366 } | 10383 } |
| 10367 DivertedTokenSource.prototype.next = function() { | 10384 DivertedTokenSource.prototype.next = function() { |
| 10368 var token = this.tokens[this._lang_pos]; | 10385 var token = this.tokens.$index(this._lang_pos); |
| 10369 ++this._lang_pos; | 10386 ++this._lang_pos; |
| 10370 if (this._lang_pos == this.tokens.get$length()) { | 10387 if (this._lang_pos == this.tokens.get$length()) { |
| 10371 this.parser.tokenizer = this.previousTokenizer; | 10388 this.parser.tokenizer = this.previousTokenizer; |
| 10372 } | 10389 } |
| 10373 return token; | 10390 return token; |
| 10374 } | 10391 } |
| 10375 DivertedTokenSource.prototype.next$0 = DivertedTokenSource.prototype.next; | 10392 DivertedTokenSource.prototype.next$0 = DivertedTokenSource.prototype.next; |
| 10376 // ********** Code for Node ************** | 10393 // ********** Code for Node ************** |
| 10377 function Node(span) { | 10394 function Node(span) { |
| 10378 this.span = span; | 10395 this.span = span; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10478 this.type = type; | 10495 this.type = type; |
| 10479 this.names = names; | 10496 this.names = names; |
| 10480 this.values = values; | 10497 this.values = values; |
| 10481 Definition.call(this, span); | 10498 Definition.call(this, span); |
| 10482 } | 10499 } |
| 10483 VariableDefinition.prototype.get$type = function() { return this.type; }; | 10500 VariableDefinition.prototype.get$type = function() { return this.type; }; |
| 10484 VariableDefinition.prototype.set$type = function(value) { return this.type = val
ue; }; | 10501 VariableDefinition.prototype.set$type = function(value) { return this.type = val
ue; }; |
| 10485 VariableDefinition.prototype.get$names = function() { return this.names; }; | 10502 VariableDefinition.prototype.get$names = function() { return this.names; }; |
| 10486 VariableDefinition.prototype.set$names = function(value) { return this.names = v
alue; }; | 10503 VariableDefinition.prototype.set$names = function(value) { return this.names = v
alue; }; |
| 10487 VariableDefinition.prototype.visit = function(visitor) { | 10504 VariableDefinition.prototype.visit = function(visitor) { |
| 10488 return visitor.visitVariableDefinition$1(this); | 10505 return visitor.visitVariableDefinition(this); |
| 10489 } | 10506 } |
| 10490 VariableDefinition.prototype.visit$1 = VariableDefinition.prototype.visit; | 10507 VariableDefinition.prototype.visit$1 = VariableDefinition.prototype.visit; |
| 10491 // ********** Code for FunctionDefinition ************** | 10508 // ********** Code for FunctionDefinition ************** |
| 10492 $inherits(FunctionDefinition, Definition); | 10509 $inherits(FunctionDefinition, Definition); |
| 10493 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
nativeBody, body, span) { | 10510 function FunctionDefinition(modifiers, returnType, name, formals, initializers,
nativeBody, body, span) { |
| 10494 this.modifiers = modifiers; | 10511 this.modifiers = modifiers; |
| 10495 this.name = name; | 10512 this.name = name; |
| 10496 this.initializers = initializers; | 10513 this.initializers = initializers; |
| 10497 this.body = body; | 10514 this.body = body; |
| 10498 this.returnType = returnType; | 10515 this.returnType = returnType; |
| 10499 this.formals = formals; | 10516 this.formals = formals; |
| 10500 this.nativeBody = nativeBody; | 10517 this.nativeBody = nativeBody; |
| 10501 Definition.call(this, span); | 10518 Definition.call(this, span); |
| 10502 } | 10519 } |
| 10503 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; | 10520 FunctionDefinition.prototype.get$returnType = function() { return this.returnTyp
e; }; |
| 10504 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; | 10521 FunctionDefinition.prototype.set$returnType = function(value) { return this.retu
rnType = value; }; |
| 10505 FunctionDefinition.prototype.get$name = function() { return this.name; }; | 10522 FunctionDefinition.prototype.get$name = function() { return this.name; }; |
| 10506 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; | 10523 FunctionDefinition.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 10507 FunctionDefinition.prototype.get$initializers = function() { return this.initial
izers; }; | 10524 FunctionDefinition.prototype.get$initializers = function() { return this.initial
izers; }; |
| 10508 FunctionDefinition.prototype.set$initializers = function(value) { return this.in
itializers = value; }; | 10525 FunctionDefinition.prototype.set$initializers = function(value) { return this.in
itializers = value; }; |
| 10509 FunctionDefinition.prototype.get$nativeBody = function() { return this.nativeBod
y; }; | 10526 FunctionDefinition.prototype.get$nativeBody = function() { return this.nativeBod
y; }; |
| 10510 FunctionDefinition.prototype.set$nativeBody = function(value) { return this.nati
veBody = value; }; | 10527 FunctionDefinition.prototype.set$nativeBody = function(value) { return this.nati
veBody = value; }; |
| 10511 FunctionDefinition.prototype.get$body = function() { return this.body; }; | 10528 FunctionDefinition.prototype.get$body = function() { return this.body; }; |
| 10512 FunctionDefinition.prototype.set$body = function(value) { return this.body = val
ue; }; | 10529 FunctionDefinition.prototype.set$body = function(value) { return this.body = val
ue; }; |
| 10513 FunctionDefinition.prototype.visit = function(visitor) { | 10530 FunctionDefinition.prototype.visit = function(visitor) { |
| 10514 return visitor.visitFunctionDefinition$1(this); | 10531 return visitor.visitFunctionDefinition(this); |
| 10515 } | 10532 } |
| 10516 FunctionDefinition.prototype.visit$1 = FunctionDefinition.prototype.visit; | 10533 FunctionDefinition.prototype.visit$1 = FunctionDefinition.prototype.visit; |
| 10517 // ********** Code for ReturnStatement ************** | 10534 // ********** Code for ReturnStatement ************** |
| 10518 $inherits(ReturnStatement, Statement); | 10535 $inherits(ReturnStatement, Statement); |
| 10519 function ReturnStatement(value, span) { | 10536 function ReturnStatement(value, span) { |
| 10520 this.value = value; | 10537 this.value = value; |
| 10521 Statement.call(this, span); | 10538 Statement.call(this, span); |
| 10522 } | 10539 } |
| 10523 ReturnStatement.prototype.get$value = function() { return this.value; }; | 10540 ReturnStatement.prototype.get$value = function() { return this.value; }; |
| 10524 ReturnStatement.prototype.set$value = function(value) { return this.value = valu
e; }; | 10541 ReturnStatement.prototype.set$value = function(value) { return this.value = valu
e; }; |
| 10525 ReturnStatement.prototype.visit = function(visitor) { | 10542 ReturnStatement.prototype.visit = function(visitor) { |
| 10526 return visitor.visitReturnStatement$1(this); | 10543 return visitor.visitReturnStatement(this); |
| 10527 } | 10544 } |
| 10528 ReturnStatement.prototype.visit$1 = ReturnStatement.prototype.visit; | 10545 ReturnStatement.prototype.visit$1 = ReturnStatement.prototype.visit; |
| 10529 // ********** Code for ThrowStatement ************** | 10546 // ********** Code for ThrowStatement ************** |
| 10530 $inherits(ThrowStatement, Statement); | 10547 $inherits(ThrowStatement, Statement); |
| 10531 function ThrowStatement(value, span) { | 10548 function ThrowStatement(value, span) { |
| 10532 this.value = value; | 10549 this.value = value; |
| 10533 Statement.call(this, span); | 10550 Statement.call(this, span); |
| 10534 } | 10551 } |
| 10535 ThrowStatement.prototype.get$value = function() { return this.value; }; | 10552 ThrowStatement.prototype.get$value = function() { return this.value; }; |
| 10536 ThrowStatement.prototype.set$value = function(value) { return this.value = value
; }; | 10553 ThrowStatement.prototype.set$value = function(value) { return this.value = value
; }; |
| 10537 ThrowStatement.prototype.visit = function(visitor) { | 10554 ThrowStatement.prototype.visit = function(visitor) { |
| 10538 return visitor.visitThrowStatement$1(this); | 10555 return visitor.visitThrowStatement(this); |
| 10539 } | 10556 } |
| 10540 ThrowStatement.prototype.visit$1 = ThrowStatement.prototype.visit; | 10557 ThrowStatement.prototype.visit$1 = ThrowStatement.prototype.visit; |
| 10541 // ********** Code for AssertStatement ************** | 10558 // ********** Code for AssertStatement ************** |
| 10542 $inherits(AssertStatement, Statement); | 10559 $inherits(AssertStatement, Statement); |
| 10543 function AssertStatement(test, span) { | 10560 function AssertStatement(test, span) { |
| 10544 this.test = test; | 10561 this.test = test; |
| 10545 Statement.call(this, span); | 10562 Statement.call(this, span); |
| 10546 } | 10563 } |
| 10547 AssertStatement.prototype.visit = function(visitor) { | 10564 AssertStatement.prototype.visit = function(visitor) { |
| 10548 return visitor.visitAssertStatement$1(this); | 10565 return visitor.visitAssertStatement(this); |
| 10549 } | 10566 } |
| 10550 AssertStatement.prototype.visit$1 = AssertStatement.prototype.visit; | 10567 AssertStatement.prototype.visit$1 = AssertStatement.prototype.visit; |
| 10551 // ********** Code for BreakStatement ************** | 10568 // ********** Code for BreakStatement ************** |
| 10552 $inherits(BreakStatement, Statement); | 10569 $inherits(BreakStatement, Statement); |
| 10553 function BreakStatement(label, span) { | 10570 function BreakStatement(label, span) { |
| 10554 this.label = label; | 10571 this.label = label; |
| 10555 Statement.call(this, span); | 10572 Statement.call(this, span); |
| 10556 } | 10573 } |
| 10557 BreakStatement.prototype.get$label = function() { return this.label; }; | 10574 BreakStatement.prototype.get$label = function() { return this.label; }; |
| 10558 BreakStatement.prototype.set$label = function(value) { return this.label = value
; }; | 10575 BreakStatement.prototype.set$label = function(value) { return this.label = value
; }; |
| 10559 BreakStatement.prototype.visit = function(visitor) { | 10576 BreakStatement.prototype.visit = function(visitor) { |
| 10560 return visitor.visitBreakStatement$1(this); | 10577 return visitor.visitBreakStatement(this); |
| 10561 } | 10578 } |
| 10562 BreakStatement.prototype.visit$1 = BreakStatement.prototype.visit; | 10579 BreakStatement.prototype.visit$1 = BreakStatement.prototype.visit; |
| 10563 // ********** Code for ContinueStatement ************** | 10580 // ********** Code for ContinueStatement ************** |
| 10564 $inherits(ContinueStatement, Statement); | 10581 $inherits(ContinueStatement, Statement); |
| 10565 function ContinueStatement(label, span) { | 10582 function ContinueStatement(label, span) { |
| 10566 this.label = label; | 10583 this.label = label; |
| 10567 Statement.call(this, span); | 10584 Statement.call(this, span); |
| 10568 } | 10585 } |
| 10569 ContinueStatement.prototype.get$label = function() { return this.label; }; | 10586 ContinueStatement.prototype.get$label = function() { return this.label; }; |
| 10570 ContinueStatement.prototype.set$label = function(value) { return this.label = va
lue; }; | 10587 ContinueStatement.prototype.set$label = function(value) { return this.label = va
lue; }; |
| 10571 ContinueStatement.prototype.visit = function(visitor) { | 10588 ContinueStatement.prototype.visit = function(visitor) { |
| 10572 return visitor.visitContinueStatement$1(this); | 10589 return visitor.visitContinueStatement(this); |
| 10573 } | 10590 } |
| 10574 ContinueStatement.prototype.visit$1 = ContinueStatement.prototype.visit; | 10591 ContinueStatement.prototype.visit$1 = ContinueStatement.prototype.visit; |
| 10575 // ********** Code for IfStatement ************** | 10592 // ********** Code for IfStatement ************** |
| 10576 $inherits(IfStatement, Statement); | 10593 $inherits(IfStatement, Statement); |
| 10577 function IfStatement(test, trueBranch, falseBranch, span) { | 10594 function IfStatement(test, trueBranch, falseBranch, span) { |
| 10578 this.test = test; | 10595 this.test = test; |
| 10579 this.falseBranch = falseBranch; | 10596 this.falseBranch = falseBranch; |
| 10580 this.trueBranch = trueBranch; | 10597 this.trueBranch = trueBranch; |
| 10581 Statement.call(this, span); | 10598 Statement.call(this, span); |
| 10582 } | 10599 } |
| 10583 IfStatement.prototype.visit = function(visitor) { | 10600 IfStatement.prototype.visit = function(visitor) { |
| 10584 return visitor.visitIfStatement$1(this); | 10601 return visitor.visitIfStatement(this); |
| 10585 } | 10602 } |
| 10586 IfStatement.prototype.visit$1 = IfStatement.prototype.visit; | 10603 IfStatement.prototype.visit$1 = IfStatement.prototype.visit; |
| 10587 // ********** Code for WhileStatement ************** | 10604 // ********** Code for WhileStatement ************** |
| 10588 $inherits(WhileStatement, Statement); | 10605 $inherits(WhileStatement, Statement); |
| 10589 function WhileStatement(test, body, span) { | 10606 function WhileStatement(test, body, span) { |
| 10590 this.body = body; | 10607 this.body = body; |
| 10591 this.test = test; | 10608 this.test = test; |
| 10592 Statement.call(this, span); | 10609 Statement.call(this, span); |
| 10593 } | 10610 } |
| 10594 WhileStatement.prototype.get$body = function() { return this.body; }; | 10611 WhileStatement.prototype.get$body = function() { return this.body; }; |
| 10595 WhileStatement.prototype.set$body = function(value) { return this.body = value;
}; | 10612 WhileStatement.prototype.set$body = function(value) { return this.body = value;
}; |
| 10596 WhileStatement.prototype.visit = function(visitor) { | 10613 WhileStatement.prototype.visit = function(visitor) { |
| 10597 return visitor.visitWhileStatement$1(this); | 10614 return visitor.visitWhileStatement(this); |
| 10598 } | 10615 } |
| 10599 WhileStatement.prototype.visit$1 = WhileStatement.prototype.visit; | 10616 WhileStatement.prototype.visit$1 = WhileStatement.prototype.visit; |
| 10600 // ********** Code for DoStatement ************** | 10617 // ********** Code for DoStatement ************** |
| 10601 $inherits(DoStatement, Statement); | 10618 $inherits(DoStatement, Statement); |
| 10602 function DoStatement(body, test, span) { | 10619 function DoStatement(body, test, span) { |
| 10603 this.body = body; | 10620 this.body = body; |
| 10604 this.test = test; | 10621 this.test = test; |
| 10605 Statement.call(this, span); | 10622 Statement.call(this, span); |
| 10606 } | 10623 } |
| 10607 DoStatement.prototype.get$body = function() { return this.body; }; | 10624 DoStatement.prototype.get$body = function() { return this.body; }; |
| 10608 DoStatement.prototype.set$body = function(value) { return this.body = value; }; | 10625 DoStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10609 DoStatement.prototype.visit = function(visitor) { | 10626 DoStatement.prototype.visit = function(visitor) { |
| 10610 return visitor.visitDoStatement$1(this); | 10627 return visitor.visitDoStatement(this); |
| 10611 } | 10628 } |
| 10612 DoStatement.prototype.visit$1 = DoStatement.prototype.visit; | 10629 DoStatement.prototype.visit$1 = DoStatement.prototype.visit; |
| 10613 // ********** Code for ForStatement ************** | 10630 // ********** Code for ForStatement ************** |
| 10614 $inherits(ForStatement, Statement); | 10631 $inherits(ForStatement, Statement); |
| 10615 function ForStatement(init, test, step, body, span) { | 10632 function ForStatement(init, test, step, body, span) { |
| 10616 this.body = body; | 10633 this.body = body; |
| 10617 this.test = test; | 10634 this.test = test; |
| 10618 this.step = step; | 10635 this.step = step; |
| 10619 this.init = init; | 10636 this.init = init; |
| 10620 Statement.call(this, span); | 10637 Statement.call(this, span); |
| 10621 } | 10638 } |
| 10622 ForStatement.prototype.get$body = function() { return this.body; }; | 10639 ForStatement.prototype.get$body = function() { return this.body; }; |
| 10623 ForStatement.prototype.set$body = function(value) { return this.body = value; }; | 10640 ForStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10624 ForStatement.prototype.visit = function(visitor) { | 10641 ForStatement.prototype.visit = function(visitor) { |
| 10625 return visitor.visitForStatement$1(this); | 10642 return visitor.visitForStatement(this); |
| 10626 } | 10643 } |
| 10627 ForStatement.prototype.visit$1 = ForStatement.prototype.visit; | 10644 ForStatement.prototype.visit$1 = ForStatement.prototype.visit; |
| 10628 // ********** Code for ForInStatement ************** | 10645 // ********** Code for ForInStatement ************** |
| 10629 $inherits(ForInStatement, Statement); | 10646 $inherits(ForInStatement, Statement); |
| 10630 function ForInStatement(item, list, body, span) { | 10647 function ForInStatement(item, list, body, span) { |
| 10631 this.body = body; | 10648 this.body = body; |
| 10632 this.item = item; | 10649 this.item = item; |
| 10633 this.list = list; | 10650 this.list = list; |
| 10634 Statement.call(this, span); | 10651 Statement.call(this, span); |
| 10635 } | 10652 } |
| 10636 ForInStatement.prototype.get$body = function() { return this.body; }; | 10653 ForInStatement.prototype.get$body = function() { return this.body; }; |
| 10637 ForInStatement.prototype.set$body = function(value) { return this.body = value;
}; | 10654 ForInStatement.prototype.set$body = function(value) { return this.body = value;
}; |
| 10638 ForInStatement.prototype.visit = function(visitor) { | 10655 ForInStatement.prototype.visit = function(visitor) { |
| 10639 return visitor.visitForInStatement$1(this); | 10656 return visitor.visitForInStatement(this); |
| 10640 } | 10657 } |
| 10641 ForInStatement.prototype.visit$1 = ForInStatement.prototype.visit; | 10658 ForInStatement.prototype.visit$1 = ForInStatement.prototype.visit; |
| 10642 // ********** Code for TryStatement ************** | 10659 // ********** Code for TryStatement ************** |
| 10643 $inherits(TryStatement, Statement); | 10660 $inherits(TryStatement, Statement); |
| 10644 function TryStatement(body, catches, finallyBlock, span) { | 10661 function TryStatement(body, catches, finallyBlock, span) { |
| 10645 this.body = body; | 10662 this.body = body; |
| 10646 this.finallyBlock = finallyBlock; | 10663 this.finallyBlock = finallyBlock; |
| 10647 this.catches = catches; | 10664 this.catches = catches; |
| 10648 Statement.call(this, span); | 10665 Statement.call(this, span); |
| 10649 } | 10666 } |
| 10650 TryStatement.prototype.get$body = function() { return this.body; }; | 10667 TryStatement.prototype.get$body = function() { return this.body; }; |
| 10651 TryStatement.prototype.set$body = function(value) { return this.body = value; }; | 10668 TryStatement.prototype.set$body = function(value) { return this.body = value; }; |
| 10652 TryStatement.prototype.visit = function(visitor) { | 10669 TryStatement.prototype.visit = function(visitor) { |
| 10653 return visitor.visitTryStatement$1(this); | 10670 return visitor.visitTryStatement(this); |
| 10654 } | 10671 } |
| 10655 TryStatement.prototype.visit$1 = TryStatement.prototype.visit; | 10672 TryStatement.prototype.visit$1 = TryStatement.prototype.visit; |
| 10656 // ********** Code for SwitchStatement ************** | 10673 // ********** Code for SwitchStatement ************** |
| 10657 $inherits(SwitchStatement, Statement); | 10674 $inherits(SwitchStatement, Statement); |
| 10658 function SwitchStatement(test, cases, span) { | 10675 function SwitchStatement(test, cases, span) { |
| 10659 this.test = test; | 10676 this.test = test; |
| 10660 this.cases = cases; | 10677 this.cases = cases; |
| 10661 Statement.call(this, span); | 10678 Statement.call(this, span); |
| 10662 } | 10679 } |
| 10663 SwitchStatement.prototype.get$cases = function() { return this.cases; }; | 10680 SwitchStatement.prototype.get$cases = function() { return this.cases; }; |
| 10664 SwitchStatement.prototype.set$cases = function(value) { return this.cases = valu
e; }; | 10681 SwitchStatement.prototype.set$cases = function(value) { return this.cases = valu
e; }; |
| 10665 SwitchStatement.prototype.visit = function(visitor) { | 10682 SwitchStatement.prototype.visit = function(visitor) { |
| 10666 return visitor.visitSwitchStatement$1(this); | 10683 return visitor.visitSwitchStatement(this); |
| 10667 } | 10684 } |
| 10668 SwitchStatement.prototype.visit$1 = SwitchStatement.prototype.visit; | 10685 SwitchStatement.prototype.visit$1 = SwitchStatement.prototype.visit; |
| 10669 // ********** Code for BlockStatement ************** | 10686 // ********** Code for BlockStatement ************** |
| 10670 $inherits(BlockStatement, Statement); | 10687 $inherits(BlockStatement, Statement); |
| 10671 function BlockStatement(body, span) { | 10688 function BlockStatement(body, span) { |
| 10672 this.body = body; | 10689 this.body = body; |
| 10673 Statement.call(this, span); | 10690 Statement.call(this, span); |
| 10674 } | 10691 } |
| 10675 BlockStatement.prototype.get$body = function() { return this.body; }; | 10692 BlockStatement.prototype.get$body = function() { return this.body; }; |
| 10676 BlockStatement.prototype.set$body = function(value) { return this.body = value;
}; | 10693 BlockStatement.prototype.set$body = function(value) { return this.body = value;
}; |
| 10677 BlockStatement.prototype.visit = function(visitor) { | 10694 BlockStatement.prototype.visit = function(visitor) { |
| 10678 return visitor.visitBlockStatement$1(this); | 10695 return visitor.visitBlockStatement(this); |
| 10679 } | 10696 } |
| 10680 BlockStatement.prototype.visit$1 = BlockStatement.prototype.visit; | 10697 BlockStatement.prototype.visit$1 = BlockStatement.prototype.visit; |
| 10681 // ********** Code for LabeledStatement ************** | 10698 // ********** Code for LabeledStatement ************** |
| 10682 $inherits(LabeledStatement, Statement); | 10699 $inherits(LabeledStatement, Statement); |
| 10683 function LabeledStatement(name, body, span) { | 10700 function LabeledStatement(name, body, span) { |
| 10684 this.body = body; | 10701 this.body = body; |
| 10685 this.name = name; | 10702 this.name = name; |
| 10686 Statement.call(this, span); | 10703 Statement.call(this, span); |
| 10687 } | 10704 } |
| 10688 LabeledStatement.prototype.get$name = function() { return this.name; }; | 10705 LabeledStatement.prototype.get$name = function() { return this.name; }; |
| 10689 LabeledStatement.prototype.set$name = function(value) { return this.name = value
; }; | 10706 LabeledStatement.prototype.set$name = function(value) { return this.name = value
; }; |
| 10690 LabeledStatement.prototype.get$body = function() { return this.body; }; | 10707 LabeledStatement.prototype.get$body = function() { return this.body; }; |
| 10691 LabeledStatement.prototype.set$body = function(value) { return this.body = value
; }; | 10708 LabeledStatement.prototype.set$body = function(value) { return this.body = value
; }; |
| 10692 LabeledStatement.prototype.visit = function(visitor) { | 10709 LabeledStatement.prototype.visit = function(visitor) { |
| 10693 return visitor.visitLabeledStatement$1(this); | 10710 return visitor.visitLabeledStatement(this); |
| 10694 } | 10711 } |
| 10695 LabeledStatement.prototype.visit$1 = LabeledStatement.prototype.visit; | 10712 LabeledStatement.prototype.visit$1 = LabeledStatement.prototype.visit; |
| 10696 // ********** Code for ExpressionStatement ************** | 10713 // ********** Code for ExpressionStatement ************** |
| 10697 $inherits(ExpressionStatement, Statement); | 10714 $inherits(ExpressionStatement, Statement); |
| 10698 function ExpressionStatement(body, span) { | 10715 function ExpressionStatement(body, span) { |
| 10699 this.body = body; | 10716 this.body = body; |
| 10700 Statement.call(this, span); | 10717 Statement.call(this, span); |
| 10701 } | 10718 } |
| 10702 ExpressionStatement.prototype.get$body = function() { return this.body; }; | 10719 ExpressionStatement.prototype.get$body = function() { return this.body; }; |
| 10703 ExpressionStatement.prototype.set$body = function(value) { return this.body = va
lue; }; | 10720 ExpressionStatement.prototype.set$body = function(value) { return this.body = va
lue; }; |
| 10704 ExpressionStatement.prototype.visit = function(visitor) { | 10721 ExpressionStatement.prototype.visit = function(visitor) { |
| 10705 return visitor.visitExpressionStatement$1(this); | 10722 return visitor.visitExpressionStatement(this); |
| 10706 } | 10723 } |
| 10707 ExpressionStatement.prototype.visit$1 = ExpressionStatement.prototype.visit; | 10724 ExpressionStatement.prototype.visit$1 = ExpressionStatement.prototype.visit; |
| 10708 // ********** Code for EmptyStatement ************** | 10725 // ********** Code for EmptyStatement ************** |
| 10709 $inherits(EmptyStatement, Statement); | 10726 $inherits(EmptyStatement, Statement); |
| 10710 function EmptyStatement(span) { | 10727 function EmptyStatement(span) { |
| 10711 Statement.call(this, span); | 10728 Statement.call(this, span); |
| 10712 } | 10729 } |
| 10713 EmptyStatement.prototype.visit = function(visitor) { | 10730 EmptyStatement.prototype.visit = function(visitor) { |
| 10714 return visitor.visitEmptyStatement$1(this); | 10731 return visitor.visitEmptyStatement(this); |
| 10715 } | 10732 } |
| 10716 EmptyStatement.prototype.visit$1 = EmptyStatement.prototype.visit; | 10733 EmptyStatement.prototype.visit$1 = EmptyStatement.prototype.visit; |
| 10717 // ********** Code for DietStatement ************** | 10734 // ********** Code for DietStatement ************** |
| 10718 $inherits(DietStatement, Statement); | 10735 $inherits(DietStatement, Statement); |
| 10719 function DietStatement(span) { | 10736 function DietStatement(span) { |
| 10720 Statement.call(this, span); | 10737 Statement.call(this, span); |
| 10721 } | 10738 } |
| 10722 DietStatement.prototype.visit = function(visitor) { | 10739 DietStatement.prototype.visit = function(visitor) { |
| 10723 return visitor.visitDietStatement$1(this); | 10740 return visitor.visitDietStatement(this); |
| 10724 } | 10741 } |
| 10725 DietStatement.prototype.visit$1 = DietStatement.prototype.visit; | 10742 DietStatement.prototype.visit$1 = DietStatement.prototype.visit; |
| 10726 // ********** Code for LambdaExpression ************** | 10743 // ********** Code for LambdaExpression ************** |
| 10727 $inherits(LambdaExpression, Expression); | 10744 $inherits(LambdaExpression, Expression); |
| 10728 function LambdaExpression(func, span) { | 10745 function LambdaExpression(func, span) { |
| 10729 this.func = func; | 10746 this.func = func; |
| 10730 Expression.call(this, span); | 10747 Expression.call(this, span); |
| 10731 } | 10748 } |
| 10732 LambdaExpression.prototype.get$func = function() { return this.func; }; | 10749 LambdaExpression.prototype.get$func = function() { return this.func; }; |
| 10733 LambdaExpression.prototype.set$func = function(value) { return this.func = value
; }; | 10750 LambdaExpression.prototype.set$func = function(value) { return this.func = value
; }; |
| 10734 LambdaExpression.prototype.visit = function(visitor) { | 10751 LambdaExpression.prototype.visit = function(visitor) { |
| 10735 return visitor.visitLambdaExpression$1(this); | 10752 return visitor.visitLambdaExpression(this); |
| 10736 } | 10753 } |
| 10737 LambdaExpression.prototype.visit$1 = LambdaExpression.prototype.visit; | 10754 LambdaExpression.prototype.visit$1 = LambdaExpression.prototype.visit; |
| 10738 // ********** Code for CallExpression ************** | 10755 // ********** Code for CallExpression ************** |
| 10739 $inherits(CallExpression, Expression); | 10756 $inherits(CallExpression, Expression); |
| 10740 function CallExpression(target, arguments, span) { | 10757 function CallExpression(target, arguments, span) { |
| 10741 this.target = target; | 10758 this.target = target; |
| 10742 this.arguments = arguments; | 10759 this.arguments = arguments; |
| 10743 Expression.call(this, span); | 10760 Expression.call(this, span); |
| 10744 } | 10761 } |
| 10745 CallExpression.prototype.visit = function(visitor) { | 10762 CallExpression.prototype.visit = function(visitor) { |
| 10746 return visitor.visitCallExpression(this); | 10763 return visitor.visitCallExpression(this); |
| 10747 } | 10764 } |
| 10748 CallExpression.prototype.visit$1 = CallExpression.prototype.visit; | 10765 CallExpression.prototype.visit$1 = CallExpression.prototype.visit; |
| 10749 // ********** Code for IndexExpression ************** | 10766 // ********** Code for IndexExpression ************** |
| 10750 $inherits(IndexExpression, Expression); | 10767 $inherits(IndexExpression, Expression); |
| 10751 function IndexExpression(target, index, span) { | 10768 function IndexExpression(target, index, span) { |
| 10752 this.target = target; | 10769 this.target = target; |
| 10753 this.index = index; | 10770 this.index = index; |
| 10754 Expression.call(this, span); | 10771 Expression.call(this, span); |
| 10755 } | 10772 } |
| 10756 IndexExpression.prototype.visit = function(visitor) { | 10773 IndexExpression.prototype.visit = function(visitor) { |
| 10757 return visitor.visitIndexExpression$1(this); | 10774 return visitor.visitIndexExpression(this); |
| 10758 } | 10775 } |
| 10759 IndexExpression.prototype.visit$1 = IndexExpression.prototype.visit; | 10776 IndexExpression.prototype.visit$1 = IndexExpression.prototype.visit; |
| 10760 // ********** Code for BinaryExpression ************** | 10777 // ********** Code for BinaryExpression ************** |
| 10761 $inherits(BinaryExpression, Expression); | 10778 $inherits(BinaryExpression, Expression); |
| 10762 function BinaryExpression(op, x, y, span) { | 10779 function BinaryExpression(op, x, y, span) { |
| 10763 this.y = y; | 10780 this.y = y; |
| 10764 this.x = x; | 10781 this.x = x; |
| 10765 this.op = op; | 10782 this.op = op; |
| 10766 Expression.call(this, span); | 10783 Expression.call(this, span); |
| 10767 } | 10784 } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10814 this.isConst = isConst; | 10831 this.isConst = isConst; |
| 10815 Expression.call(this, span); | 10832 Expression.call(this, span); |
| 10816 } | 10833 } |
| 10817 NewExpression.prototype.get$isConst = function() { return this.isConst; }; | 10834 NewExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10818 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; | 10835 NewExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; |
| 10819 NewExpression.prototype.get$type = function() { return this.type; }; | 10836 NewExpression.prototype.get$type = function() { return this.type; }; |
| 10820 NewExpression.prototype.set$type = function(value) { return this.type = value; }
; | 10837 NewExpression.prototype.set$type = function(value) { return this.type = value; }
; |
| 10821 NewExpression.prototype.get$name = function() { return this.name; }; | 10838 NewExpression.prototype.get$name = function() { return this.name; }; |
| 10822 NewExpression.prototype.set$name = function(value) { return this.name = value; }
; | 10839 NewExpression.prototype.set$name = function(value) { return this.name = value; }
; |
| 10823 NewExpression.prototype.visit = function(visitor) { | 10840 NewExpression.prototype.visit = function(visitor) { |
| 10824 return visitor.visitNewExpression$1(this); | 10841 return visitor.visitNewExpression(this); |
| 10825 } | 10842 } |
| 10826 NewExpression.prototype.visit$1 = NewExpression.prototype.visit; | 10843 NewExpression.prototype.visit$1 = NewExpression.prototype.visit; |
| 10827 // ********** Code for ListExpression ************** | 10844 // ********** Code for ListExpression ************** |
| 10828 $inherits(ListExpression, Expression); | 10845 $inherits(ListExpression, Expression); |
| 10829 function ListExpression(isConst, itemType, values, span) { | 10846 function ListExpression(isConst, itemType, values, span) { |
| 10830 this.itemType = itemType; | 10847 this.itemType = itemType; |
| 10831 this.isConst = isConst; | 10848 this.isConst = isConst; |
| 10832 this.values = values; | 10849 this.values = values; |
| 10833 Expression.call(this, span); | 10850 Expression.call(this, span); |
| 10834 } | 10851 } |
| 10835 ListExpression.prototype.get$isConst = function() { return this.isConst; }; | 10852 ListExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10836 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; | 10853 ListExpression.prototype.set$isConst = function(value) { return this.isConst = v
alue; }; |
| 10837 ListExpression.prototype.visit = function(visitor) { | 10854 ListExpression.prototype.visit = function(visitor) { |
| 10838 return visitor.visitListExpression(this); | 10855 return visitor.visitListExpression(this); |
| 10839 } | 10856 } |
| 10840 ListExpression.prototype.visit$1 = ListExpression.prototype.visit; | 10857 ListExpression.prototype.visit$1 = ListExpression.prototype.visit; |
| 10841 // ********** Code for MapExpression ************** | 10858 // ********** Code for MapExpression ************** |
| 10842 $inherits(MapExpression, Expression); | 10859 $inherits(MapExpression, Expression); |
| 10843 function MapExpression(isConst, keyType, valueType, items, span) { | 10860 function MapExpression(isConst, keyType, valueType, items, span) { |
| 10844 this.keyType = keyType; | 10861 this.keyType = keyType; |
| 10845 this.valueType = valueType; | 10862 this.valueType = valueType; |
| 10846 this.items = items; | 10863 this.items = items; |
| 10847 this.isConst = isConst; | 10864 this.isConst = isConst; |
| 10848 Expression.call(this, span); | 10865 Expression.call(this, span); |
| 10849 } | 10866 } |
| 10850 MapExpression.prototype.get$isConst = function() { return this.isConst; }; | 10867 MapExpression.prototype.get$isConst = function() { return this.isConst; }; |
| 10851 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; | 10868 MapExpression.prototype.set$isConst = function(value) { return this.isConst = va
lue; }; |
| 10852 MapExpression.prototype.visit = function(visitor) { | 10869 MapExpression.prototype.visit = function(visitor) { |
| 10853 return visitor.visitMapExpression$1(this); | 10870 return visitor.visitMapExpression(this); |
| 10854 } | 10871 } |
| 10855 MapExpression.prototype.visit$1 = MapExpression.prototype.visit; | 10872 MapExpression.prototype.visit$1 = MapExpression.prototype.visit; |
| 10856 // ********** Code for ConditionalExpression ************** | 10873 // ********** Code for ConditionalExpression ************** |
| 10857 $inherits(ConditionalExpression, Expression); | 10874 $inherits(ConditionalExpression, Expression); |
| 10858 function ConditionalExpression(test, trueBranch, falseBranch, span) { | 10875 function ConditionalExpression(test, trueBranch, falseBranch, span) { |
| 10859 this.test = test; | 10876 this.test = test; |
| 10860 this.falseBranch = falseBranch; | 10877 this.falseBranch = falseBranch; |
| 10861 this.trueBranch = trueBranch; | 10878 this.trueBranch = trueBranch; |
| 10862 Expression.call(this, span); | 10879 Expression.call(this, span); |
| 10863 } | 10880 } |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10952 SuperExpression.prototype.visit$1 = SuperExpression.prototype.visit; | 10969 SuperExpression.prototype.visit$1 = SuperExpression.prototype.visit; |
| 10953 // ********** Code for LiteralExpression ************** | 10970 // ********** Code for LiteralExpression ************** |
| 10954 $inherits(LiteralExpression, Expression); | 10971 $inherits(LiteralExpression, Expression); |
| 10955 function LiteralExpression(value, span) { | 10972 function LiteralExpression(value, span) { |
| 10956 this.value = value; | 10973 this.value = value; |
| 10957 Expression.call(this, span); | 10974 Expression.call(this, span); |
| 10958 } | 10975 } |
| 10959 LiteralExpression.prototype.get$value = function() { return this.value; }; | 10976 LiteralExpression.prototype.get$value = function() { return this.value; }; |
| 10960 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; | 10977 LiteralExpression.prototype.set$value = function(value) { return this.value = va
lue; }; |
| 10961 LiteralExpression.prototype.visit = function(visitor) { | 10978 LiteralExpression.prototype.visit = function(visitor) { |
| 10962 return visitor.visitLiteralExpression$1(this); | 10979 return visitor.visitLiteralExpression(this); |
| 10963 } | 10980 } |
| 10964 LiteralExpression.prototype.visit$1 = LiteralExpression.prototype.visit; | 10981 LiteralExpression.prototype.visit$1 = LiteralExpression.prototype.visit; |
| 10965 // ********** Code for StringInterpExpression ************** | 10982 // ********** Code for StringInterpExpression ************** |
| 10966 $inherits(StringInterpExpression, Expression); | 10983 $inherits(StringInterpExpression, Expression); |
| 10967 function StringInterpExpression(pieces, span) { | 10984 function StringInterpExpression(pieces, span) { |
| 10968 this.pieces = pieces; | 10985 this.pieces = pieces; |
| 10969 Expression.call(this, span); | 10986 Expression.call(this, span); |
| 10970 } | 10987 } |
| 10971 StringInterpExpression.prototype.visit = function(visitor) { | 10988 StringInterpExpression.prototype.visit = function(visitor) { |
| 10972 return visitor.visitStringInterpExpression(this); | 10989 return visitor.visitStringInterpExpression(this); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11142 function DeclaredIdentifier(type, name, span) { | 11159 function DeclaredIdentifier(type, name, span) { |
| 11143 this.name = name; | 11160 this.name = name; |
| 11144 this.type = type; | 11161 this.type = type; |
| 11145 Expression.call(this, span); | 11162 Expression.call(this, span); |
| 11146 } | 11163 } |
| 11147 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; | 11164 DeclaredIdentifier.prototype.get$type = function() { return this.type; }; |
| 11148 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val
ue; }; | 11165 DeclaredIdentifier.prototype.set$type = function(value) { return this.type = val
ue; }; |
| 11149 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; | 11166 DeclaredIdentifier.prototype.get$name = function() { return this.name; }; |
| 11150 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; | 11167 DeclaredIdentifier.prototype.set$name = function(value) { return this.name = val
ue; }; |
| 11151 DeclaredIdentifier.prototype.visit = function(visitor) { | 11168 DeclaredIdentifier.prototype.visit = function(visitor) { |
| 11152 return visitor.visitDeclaredIdentifier$1(this); | 11169 return visitor.visitDeclaredIdentifier(this); |
| 11153 } | 11170 } |
| 11154 DeclaredIdentifier.prototype.visit$1 = DeclaredIdentifier.prototype.visit; | 11171 DeclaredIdentifier.prototype.visit$1 = DeclaredIdentifier.prototype.visit; |
| 11155 // ********** Code for Type ************** | 11172 // ********** Code for Type ************** |
| 11156 $inherits(Type, Element); | 11173 $inherits(Type, Element); |
| 11157 function Type(name) { | 11174 function Type(name) { |
| 11158 this.isTested = false; | 11175 this.isTested = false; |
| 11159 this._foundMembers = new HashMapImplementation(); | 11176 this._resolvedMembers = new HashMapImplementation(); |
| 11160 this.isChecked = false; | 11177 this.isChecked = false; |
| 11161 this.isWritten = false; | 11178 this.isWritten = false; |
| 11162 this.varStubs = new HashMapImplementation(); | 11179 this.varStubs = new HashMapImplementation(); |
| 11163 Element.call(this, name, null); | 11180 Element.call(this, name, null); |
| 11164 } | 11181 } |
| 11165 Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; }; | 11182 Type.prototype.get$typeCheckCode = function() { return this.typeCheckCode; }; |
| 11166 Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckCode =
value; }; | 11183 Type.prototype.set$typeCheckCode = function(value) { return this.typeCheckCode =
value; }; |
| 11167 Type.prototype.get$varStubs = function() { return this.varStubs; }; | 11184 Type.prototype.get$varStubs = function() { return this.varStubs; }; |
| 11168 Type.prototype.set$varStubs = function(value) { return this.varStubs = value; }; | 11185 Type.prototype.set$varStubs = function(value) { return this.varStubs = value; }; |
| 11169 Type.prototype.markUsed = function() { | 11186 Type.prototype.markUsed = function() { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11295 var typeParam = params.next$0(); | 11312 var typeParam = params.next$0(); |
| 11296 var typeArg = args.next$0(); | 11313 var typeArg = args.next$0(); |
| 11297 if (typeParam.get$extendsType() != null && typeArg != null) { | 11314 if (typeParam.get$extendsType() != null && typeArg != null) { |
| 11298 typeArg.ensureSubtypeOf$3(typeParam.get$extendsType(), typeParam.get$spa
n(), true); | 11315 typeArg.ensureSubtypeOf$3(typeParam.get$extendsType(), typeParam.get$spa
n(), true); |
| 11299 } | 11316 } |
| 11300 } | 11317 } |
| 11301 } | 11318 } |
| 11302 if (this.get$interfaces() != null) { | 11319 if (this.get$interfaces() != null) { |
| 11303 var $$list = this.get$interfaces(); | 11320 var $$list = this.get$interfaces(); |
| 11304 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11321 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11305 var i = $$list[$$i]; | 11322 var i = $$list.$index($$i); |
| 11306 i._checkExtends$0(); | 11323 i._checkExtends$0(); |
| 11307 } | 11324 } |
| 11308 } | 11325 } |
| 11309 } | 11326 } |
| 11310 Type.prototype._checkOverride = function(member) { | 11327 Type.prototype._checkOverride = function(member) { |
| 11311 var parentMember = this._getMemberInParents(member.name); | 11328 var parentMember = this._getMemberInParents(member.name); |
| 11312 if (parentMember != null) { | 11329 if (parentMember != null) { |
| 11313 if (!member.get$isPrivate() || $eq(member.get$library(), parentMember.get$li
brary())) { | 11330 if (!member.get$isPrivate() || $eq(member.get$library(), parentMember.get$li
brary())) { |
| 11314 member.override(parentMember); | 11331 member.override(parentMember); |
| 11315 } | 11332 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 11334 return this.get$parent().getMember(memberName); | 11351 return this.get$parent().getMember(memberName); |
| 11335 } | 11352 } |
| 11336 else { | 11353 else { |
| 11337 return null; | 11354 return null; |
| 11338 } | 11355 } |
| 11339 } | 11356 } |
| 11340 else { | 11357 else { |
| 11341 if (this.get$interfaces() != null && this.get$interfaces().get$length() > (0
)) { | 11358 if (this.get$interfaces() != null && this.get$interfaces().get$length() > (0
)) { |
| 11342 var $$list = this.get$interfaces(); | 11359 var $$list = this.get$interfaces(); |
| 11343 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11360 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11344 var i = $$list[$$i]; | 11361 var i = $$list.$index($$i); |
| 11345 var ret = i.getMember$1(memberName); | 11362 var ret = i.getMember$1(memberName); |
| 11346 if (ret != null) { | 11363 if (ret != null) { |
| 11347 return ret; | 11364 return ret; |
| 11348 } | 11365 } |
| 11349 } | 11366 } |
| 11350 } | 11367 } |
| 11351 return $globals.world.objectType.getMember(memberName); | 11368 return $globals.world.objectType.getMember(memberName); |
| 11352 } | 11369 } |
| 11353 } | 11370 } |
| 11371 Type.prototype.resolveMember = function(memberName) { |
| 11372 var ret = this._resolvedMembers.$index(memberName); |
| 11373 if (ret != null) return ret; |
| 11374 var member = this.getMember(memberName); |
| 11375 if (member == null) { |
| 11376 return null; |
| 11377 } |
| 11378 ret = new MemberSet(member, false); |
| 11379 this._resolvedMembers.$setindex(memberName, ret); |
| 11380 if (member.get$isStatic()) { |
| 11381 return ret; |
| 11382 } |
| 11383 else { |
| 11384 var $$list = this.get$subtypes(); |
| 11385 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 11386 var t = $$i.next$0(); |
| 11387 if (!this.get$isClass() && t.get$isClass()) { |
| 11388 var m = t.getMember$1(memberName); |
| 11389 if (m != null && ret.members.indexOf(m) == (-1)) { |
| 11390 ret.add(m); |
| 11391 } |
| 11392 } |
| 11393 else { |
| 11394 var m = t.get$members().$index(memberName); |
| 11395 if (m != null) ret.add(m); |
| 11396 } |
| 11397 } |
| 11398 return ret; |
| 11399 } |
| 11400 } |
| 11354 Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { | 11401 Type.prototype.ensureSubtypeOf = function(other, span, typeErrors) { |
| 11355 if (!this.isSubtypeOf(other)) { | 11402 if (!this.isSubtypeOf(other)) { |
| 11356 var msg = ("type " + this.name + " is not a subtype of " + other.name); | 11403 var msg = ("type " + this.name + " is not a subtype of " + other.name); |
| 11357 if (typeErrors) { | 11404 if (typeErrors) { |
| 11358 $globals.world.error(msg, span); | 11405 $globals.world.error(msg, span); |
| 11359 } | 11406 } |
| 11360 else { | 11407 else { |
| 11361 $globals.world.warning(msg, span); | 11408 $globals.world.warning(msg, span); |
| 11362 } | 11409 } |
| 11363 } | 11410 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11492 } | 11539 } |
| 11493 ParameterType.prototype.getCallMethod = function() { | 11540 ParameterType.prototype.getCallMethod = function() { |
| 11494 return this.extendsType.getCallMethod(); | 11541 return this.extendsType.getCallMethod(); |
| 11495 } | 11542 } |
| 11496 ParameterType.prototype.genMethod = function(method) { | 11543 ParameterType.prototype.genMethod = function(method) { |
| 11497 this.extendsType.genMethod(method); | 11544 this.extendsType.genMethod(method); |
| 11498 } | 11545 } |
| 11499 ParameterType.prototype.isSubtypeOf = function(other) { | 11546 ParameterType.prototype.isSubtypeOf = function(other) { |
| 11500 return true; | 11547 return true; |
| 11501 } | 11548 } |
| 11549 ParameterType.prototype.resolveMember = function(memberName) { |
| 11550 return this.extendsType.resolveMember(memberName); |
| 11551 } |
| 11502 ParameterType.prototype.getConstructor = function(constructorName) { | 11552 ParameterType.prototype.getConstructor = function(constructorName) { |
| 11503 $globals.world.internalError("no constructors on type parameters yet"); | 11553 $globals.world.internalError("no constructors on type parameters yet"); |
| 11504 } | 11554 } |
| 11505 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11555 ParameterType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 11506 $globals.world.internalError("no concrete types of type parameters yet", this.
get$span()); | 11556 $globals.world.internalError("no concrete types of type parameters yet", this.
get$span()); |
| 11507 } | 11557 } |
| 11508 ParameterType.prototype.resolveTypeParams = function(inType) { | 11558 ParameterType.prototype.resolveTypeParams = function(inType) { |
| 11509 return inType.typeArguments.$index(this.name); | 11559 return inType.typeArguments.$index(this.name); |
| 11510 } | 11560 } |
| 11511 ParameterType.prototype.addDirectSubtype = function(type) { | 11561 ParameterType.prototype.addDirectSubtype = function(type) { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 11538 NonNullableType.prototype.get$isBool = function() { | 11588 NonNullableType.prototype.get$isBool = function() { |
| 11539 return this.type.get$isBool(); | 11589 return this.type.get$isBool(); |
| 11540 } | 11590 } |
| 11541 NonNullableType.prototype.get$isUsed = function() { | 11591 NonNullableType.prototype.get$isUsed = function() { |
| 11542 return false; | 11592 return false; |
| 11543 } | 11593 } |
| 11544 NonNullableType.prototype.isSubtypeOf = function(other) { | 11594 NonNullableType.prototype.isSubtypeOf = function(other) { |
| 11545 return $eq(this, other) || $eq(this.type, other) || this.type.isSubtypeOf(othe
r); | 11595 return $eq(this, other) || $eq(this.type, other) || this.type.isSubtypeOf(othe
r); |
| 11546 } | 11596 } |
| 11547 NonNullableType.prototype.resolveType = function(node, isRequired) { | 11597 NonNullableType.prototype.resolveType = function(node, isRequired) { |
| 11548 return this.type.resolveType$2(node, isRequired); | 11598 return this.type.resolveType(node, isRequired); |
| 11549 } | 11599 } |
| 11550 NonNullableType.prototype.resolveTypeParams = function(inType) { | 11600 NonNullableType.prototype.resolveTypeParams = function(inType) { |
| 11551 return this.type.resolveTypeParams(inType); | 11601 return this.type.resolveTypeParams(inType); |
| 11552 } | 11602 } |
| 11553 NonNullableType.prototype.addDirectSubtype = function(subtype) { | 11603 NonNullableType.prototype.addDirectSubtype = function(subtype) { |
| 11554 this.type.addDirectSubtype$1(subtype); | 11604 this.type.addDirectSubtype(subtype); |
| 11555 } | 11605 } |
| 11556 NonNullableType.prototype.markUsed = function() { | 11606 NonNullableType.prototype.markUsed = function() { |
| 11557 this.type.markUsed(); | 11607 this.type.markUsed(); |
| 11558 } | 11608 } |
| 11559 NonNullableType.prototype.genMethod = function(method) { | 11609 NonNullableType.prototype.genMethod = function(method) { |
| 11560 this.type.genMethod(method); | 11610 this.type.genMethod(method); |
| 11561 } | 11611 } |
| 11562 NonNullableType.prototype.get$span = function() { | 11612 NonNullableType.prototype.get$span = function() { |
| 11563 return this.type.get$span(); | 11613 return this.type.get$span(); |
| 11564 } | 11614 } |
| 11615 NonNullableType.prototype.resolveMember = function(name) { |
| 11616 return this.type.resolveMember(name); |
| 11617 } |
| 11565 NonNullableType.prototype.getMember = function(name) { | 11618 NonNullableType.prototype.getMember = function(name) { |
| 11566 return this.type.getMember(name); | 11619 return this.type.getMember(name); |
| 11567 } | 11620 } |
| 11568 NonNullableType.prototype.getConstructor = function(name) { | 11621 NonNullableType.prototype.getConstructor = function(name) { |
| 11569 return this.type.getConstructor$1(name); | 11622 return this.type.getConstructor$1(name); |
| 11570 } | 11623 } |
| 11571 NonNullableType.prototype.getFactory = function(t, name) { | 11624 NonNullableType.prototype.getFactory = function(t, name) { |
| 11572 return this.type.getFactory$2(t, name); | 11625 return this.type.getFactory$2(t, name); |
| 11573 } | 11626 } |
| 11574 NonNullableType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11627 NonNullableType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11659 ConcreteType.prototype.get$isClass = function() { | 11712 ConcreteType.prototype.get$isClass = function() { |
| 11660 return this.genericType.isClass; | 11713 return this.genericType.isClass; |
| 11661 } | 11714 } |
| 11662 ConcreteType.prototype.get$library = function() { | 11715 ConcreteType.prototype.get$library = function() { |
| 11663 return this.genericType.library; | 11716 return this.genericType.library; |
| 11664 } | 11717 } |
| 11665 ConcreteType.prototype.get$span = function() { | 11718 ConcreteType.prototype.get$span = function() { |
| 11666 return this.genericType.get$span(); | 11719 return this.genericType.get$span(); |
| 11667 } | 11720 } |
| 11668 ConcreteType.prototype.get$hasTypeParams = function() { | 11721 ConcreteType.prototype.get$hasTypeParams = function() { |
| 11669 return this.typeArguments.getValues().some((function (e) { | 11722 return this.typeArguments.getValues$0().some$1((function (e) { |
| 11670 return (e instanceof ParameterType); | 11723 return (e instanceof ParameterType); |
| 11671 }) | 11724 }) |
| 11672 ); | 11725 ); |
| 11673 } | 11726 } |
| 11674 ConcreteType.prototype.get$isUsed = function() { return this.isUsed; }; | 11727 ConcreteType.prototype.get$isUsed = function() { return this.isUsed; }; |
| 11675 ConcreteType.prototype.set$isUsed = function(value) { return this.isUsed = value
; }; | 11728 ConcreteType.prototype.set$isUsed = function(value) { return this.isUsed = value
; }; |
| 11676 ConcreteType.prototype.get$members = function() { return this.members; }; | 11729 ConcreteType.prototype.get$members = function() { return this.members; }; |
| 11677 ConcreteType.prototype.set$members = function(value) { return this.members = val
ue; }; | 11730 ConcreteType.prototype.set$members = function(value) { return this.members = val
ue; }; |
| 11678 ConcreteType.prototype.get$constructors = function() { return this.constructors;
}; | 11731 ConcreteType.prototype.get$constructors = function() { return this.constructors;
}; |
| 11679 ConcreteType.prototype.set$constructors = function(value) { return this.construc
tors = value; }; | 11732 ConcreteType.prototype.set$constructors = function(value) { return this.construc
tors = value; }; |
| 11680 ConcreteType.prototype.get$factories = function() { return this.factories; }; | 11733 ConcreteType.prototype.get$factories = function() { return this.factories; }; |
| 11681 ConcreteType.prototype.set$factories = function(value) { return this.factories =
value; }; | 11734 ConcreteType.prototype.set$factories = function(value) { return this.factories =
value; }; |
| 11682 ConcreteType.prototype.resolveTypeParams = function(inType) { | 11735 ConcreteType.prototype.resolveTypeParams = function(inType) { |
| 11683 var newTypeArgs = []; | 11736 var newTypeArgs = []; |
| 11684 var needsNewType = false; | 11737 var needsNewType = false; |
| 11685 var $$list = this.typeArgsInOrder; | 11738 var $$list = this.typeArgsInOrder; |
| 11686 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11739 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11687 var t = $$list[$$i]; | 11740 var t = $$list.$index($$i); |
| 11688 var newType = t.resolveTypeParams$1(inType); | 11741 var newType = t.resolveTypeParams$1(inType); |
| 11689 if ($ne(newType, t)) needsNewType = true; | 11742 if ($ne(newType, t)) needsNewType = true; |
| 11690 newTypeArgs.add$1(newType); | 11743 newTypeArgs.add$1(newType); |
| 11691 } | 11744 } |
| 11692 if (!needsNewType) return this; | 11745 if (!needsNewType) return this; |
| 11693 return this.genericType.getOrMakeConcreteType(newTypeArgs); | 11746 return this.genericType.getOrMakeConcreteType(newTypeArgs); |
| 11694 } | 11747 } |
| 11695 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { | 11748 ConcreteType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 11696 return this.genericType.getOrMakeConcreteType(typeArgs); | 11749 return this.genericType.getOrMakeConcreteType(typeArgs); |
| 11697 } | 11750 } |
| 11698 ConcreteType.prototype.get$parent = function() { | 11751 ConcreteType.prototype.get$parent = function() { |
| 11699 if (this._parent == null && this.genericType.get$parent() != null) { | 11752 if (this._parent == null && this.genericType.get$parent() != null) { |
| 11700 this._parent = this.genericType.get$parent().resolveTypeParams(this); | 11753 this._parent = this.genericType.get$parent().resolveTypeParams(this); |
| 11701 } | 11754 } |
| 11702 return this._parent; | 11755 return this._parent; |
| 11703 } | 11756 } |
| 11704 ConcreteType.prototype.get$interfaces = function() { | 11757 ConcreteType.prototype.get$interfaces = function() { |
| 11705 if (this._interfaces == null && this.genericType.interfaces != null) { | 11758 if (this._interfaces == null && this.genericType.interfaces != null) { |
| 11706 this._interfaces = []; | 11759 this._interfaces = []; |
| 11707 var $$list = this.genericType.interfaces; | 11760 var $$list = this.genericType.interfaces; |
| 11708 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11761 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11709 var i = $$list[$$i]; | 11762 var i = $$list.$index($$i); |
| 11710 this._interfaces.add(i.resolveTypeParams$1(this)); | 11763 this._interfaces.add(i.resolveTypeParams$1(this)); |
| 11711 } | 11764 } |
| 11712 } | 11765 } |
| 11713 return this._interfaces; | 11766 return this._interfaces; |
| 11714 } | 11767 } |
| 11715 ConcreteType.prototype.get$subtypes = function() { | 11768 ConcreteType.prototype.get$subtypes = function() { |
| 11716 if (this._subtypes == null) { | 11769 if (this._subtypes == null) { |
| 11717 this._subtypes = new HashSetImplementation(); | 11770 this._subtypes = new HashSetImplementation(); |
| 11718 var $$list = this.genericType.get$subtypes(); | 11771 var $$list = this.genericType.get$subtypes(); |
| 11719 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 11772 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11768 ret = new ConcreteMember(genericMember.get$name(), this, genericMember); | 11821 ret = new ConcreteMember(genericMember.get$name(), this, genericMember); |
| 11769 this.factories.addFactory(this.name, constructorName, ret); | 11822 this.factories.addFactory(this.name, constructorName, ret); |
| 11770 } | 11823 } |
| 11771 else { | 11824 else { |
| 11772 ret = new ConcreteMember(this.name, this, genericMember); | 11825 ret = new ConcreteMember(this.name, this, genericMember); |
| 11773 this.constructors.$setindex(constructorName, ret); | 11826 this.constructors.$setindex(constructorName, ret); |
| 11774 } | 11827 } |
| 11775 return ret; | 11828 return ret; |
| 11776 } | 11829 } |
| 11777 ConcreteType.prototype.getMember = function(memberName) { | 11830 ConcreteType.prototype.getMember = function(memberName) { |
| 11778 var member = this._foundMembers.$index(memberName); | 11831 var member = this.members.$index(memberName); |
| 11779 if (member != null) return member; | |
| 11780 member = this.members.$index(memberName); | |
| 11781 if (member != null) { | 11832 if (member != null) { |
| 11782 this._checkOverride(member); | 11833 this._checkOverride(member); |
| 11783 this._foundMembers.$setindex(memberName, member); | |
| 11784 return member; | 11834 return member; |
| 11785 } | 11835 } |
| 11786 var genericMember = this.genericType.members.$index(memberName); | 11836 var genericMember = this.genericType.members.$index(memberName); |
| 11787 if (genericMember != null) { | 11837 if (genericMember != null) { |
| 11788 member = new ConcreteMember(genericMember.get$name(), this, genericMember); | 11838 member = new ConcreteMember(genericMember.get$name(), this, genericMember); |
| 11789 this.members.$setindex(memberName, member); | 11839 this.members.$setindex(memberName, member); |
| 11790 this._foundMembers.$setindex(memberName, member); | |
| 11791 return member; | 11840 return member; |
| 11792 } | 11841 } |
| 11793 member = this._getMemberInParents(memberName); | 11842 return this._getMemberInParents(memberName); |
| 11794 this._foundMembers.$setindex(memberName, member); | |
| 11795 return member; | |
| 11796 } | 11843 } |
| 11797 ConcreteType.prototype.resolveType = function(node, isRequired) { | 11844 ConcreteType.prototype.resolveType = function(node, isRequired) { |
| 11798 var ret = this.genericType.resolveType$2(node, isRequired); | 11845 var ret = this.genericType.resolveType(node, isRequired); |
| 11799 return ret; | 11846 return ret; |
| 11800 } | 11847 } |
| 11801 ConcreteType.prototype.addDirectSubtype = function(type) { | 11848 ConcreteType.prototype.addDirectSubtype = function(type) { |
| 11802 this.genericType.addDirectSubtype(type); | 11849 this.genericType.addDirectSubtype(type); |
| 11803 } | 11850 } |
| 11804 ConcreteType.prototype.addDirectSubtype$1 = ConcreteType.prototype.addDirectSubt
ype; | 11851 ConcreteType.prototype.addDirectSubtype$1 = ConcreteType.prototype.addDirectSubt
ype; |
| 11805 ConcreteType.prototype.getConstructor$1 = ConcreteType.prototype.getConstructor; | 11852 ConcreteType.prototype.getConstructor$1 = ConcreteType.prototype.getConstructor; |
| 11806 ConcreteType.prototype.getFactory$2 = ConcreteType.prototype.getFactory; | 11853 ConcreteType.prototype.getFactory$2 = ConcreteType.prototype.getFactory; |
| 11807 ConcreteType.prototype.getMember$1 = ConcreteType.prototype.getMember; | 11854 ConcreteType.prototype.getMember$1 = ConcreteType.prototype.getMember; |
| 11808 ConcreteType.prototype.getOrMakeConcreteType$1 = ConcreteType.prototype.getOrMak
eConcreteType; | 11855 ConcreteType.prototype.getOrMakeConcreteType$1 = ConcreteType.prototype.getOrMak
eConcreteType; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11920 DefinedType.prototype.getAllMembers = function() { | 11967 DefinedType.prototype.getAllMembers = function() { |
| 11921 return HashMapImplementation.HashMapImplementation$from$factory(this.members); | 11968 return HashMapImplementation.HashMapImplementation$from$factory(this.members); |
| 11922 } | 11969 } |
| 11923 DefinedType.prototype.markUsed = function() { | 11970 DefinedType.prototype.markUsed = function() { |
| 11924 if (this.isUsed) return; | 11971 if (this.isUsed) return; |
| 11925 this.isUsed = true; | 11972 this.isUsed = true; |
| 11926 this._checkExtends(); | 11973 this._checkExtends(); |
| 11927 if (this._lazyGenMethods != null) { | 11974 if (this._lazyGenMethods != null) { |
| 11928 var $$list = orderValuesByKeys(this._lazyGenMethods); | 11975 var $$list = orderValuesByKeys(this._lazyGenMethods); |
| 11929 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 11976 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 11930 var method = $$list[$$i]; | 11977 var method = $$list.$index($$i); |
| 11931 $globals.world.gen.genMethod(method); | 11978 $globals.world.gen.genMethod(method); |
| 11932 } | 11979 } |
| 11933 this._lazyGenMethods = null; | 11980 this._lazyGenMethods = null; |
| 11934 } | 11981 } |
| 11935 if (this.get$parent() != null) this.get$parent().markUsed(); | 11982 if (this.get$parent() != null) this.get$parent().markUsed(); |
| 11936 } | 11983 } |
| 11937 DefinedType.prototype.genMethod = function(method) { | 11984 DefinedType.prototype.genMethod = function(method) { |
| 11938 if (this.isUsed) { | 11985 if (this.isUsed) { |
| 11939 $globals.world.gen.genMethod(method); | 11986 $globals.world.gen.genMethod(method); |
| 11940 } | 11987 } |
| 11941 else if (this.isClass) { | 11988 else if (this.isClass) { |
| 11942 if (this._lazyGenMethods == null) this._lazyGenMethods = new HashMapImplemen
tation(); | 11989 if (this._lazyGenMethods == null) this._lazyGenMethods = new HashMapImplemen
tation(); |
| 11943 this._lazyGenMethods.$setindex(method.name, method); | 11990 this._lazyGenMethods.$setindex(method.name, method); |
| 11944 } | 11991 } |
| 11945 } | 11992 } |
| 11946 DefinedType.prototype._resolveInterfaces = function(types) { | 11993 DefinedType.prototype._resolveInterfaces = function(types) { |
| 11947 if (types == null) return []; | 11994 if (types == null) return []; |
| 11948 var interfaces = []; | 11995 var interfaces = []; |
| 11949 for (var $$i = 0;$$i < types.get$length(); $$i++) { | 11996 for (var $$i = 0;$$i < types.get$length(); $$i++) { |
| 11950 var type = types[$$i]; | 11997 var type = types.$index($$i); |
| 11951 var resolvedInterface = this.resolveType$2(type, true); | 11998 var resolvedInterface = this.resolveType(type, true); |
| 11952 if (resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this.
library.get$isCoreImpl())) { | 11999 if (resolvedInterface.get$isClosed() && !(this.library.get$isCore() || this.
library.get$isCoreImpl())) { |
| 11953 $globals.world.error(("can not implement \"" + resolvedInterface.get$name(
) + "\": ") + "only native implementation allowed", type.get$span()); | 12000 $globals.world.error(("can not implement \"" + resolvedInterface.get$name(
) + "\": ") + "only native implementation allowed", type.get$span()); |
| 11954 } | 12001 } |
| 11955 resolvedInterface.addDirectSubtype$1(this); | 12002 resolvedInterface.addDirectSubtype$1(this); |
| 11956 interfaces.add$1(resolvedInterface); | 12003 interfaces.add$1(resolvedInterface); |
| 11957 } | 12004 } |
| 11958 return interfaces; | 12005 return interfaces; |
| 11959 } | 12006 } |
| 11960 DefinedType.prototype.addDirectSubtype = function(type) { | 12007 DefinedType.prototype.addDirectSubtype = function(type) { |
| 11961 this.directSubtypes.add(type); | 12008 this.directSubtypes.add(type); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11996 if (ancestor == null) return false; | 12043 if (ancestor == null) return false; |
| 11997 if (ancestor == $this) return true; | 12044 if (ancestor == $this) return true; |
| 11998 if (seen.contains$1(ancestor)) { | 12045 if (seen.contains$1(ancestor)) { |
| 11999 return false; | 12046 return false; |
| 12000 } | 12047 } |
| 12001 seen.add$1(ancestor); | 12048 seen.add$1(ancestor); |
| 12002 if (ancestor.get$interfaces() != null) { | 12049 if (ancestor.get$interfaces() != null) { |
| 12003 var $$list = ancestor.get$interfaces(); | 12050 var $$list = ancestor.get$interfaces(); |
| 12004 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12051 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12005 var parent = $$i.next$0(); | 12052 var parent = $$i.next$0(); |
| 12006 if (_helper.call$1(parent)) return true; | 12053 if (_helper(parent)) return true; |
| 12007 } | 12054 } |
| 12008 } | 12055 } |
| 12009 return false; | 12056 return false; |
| 12010 } | 12057 } |
| 12011 for (var i = (0); | 12058 for (var i = (0); |
| 12012 i < this.interfaces.get$length(); i++) { | 12059 i < this.interfaces.get$length(); i++) { |
| 12013 if (_helper.call$1(this.interfaces[i])) return i; | 12060 if (_helper(this.interfaces.$index(i))) return i; |
| 12014 } | 12061 } |
| 12015 return (-1); | 12062 return (-1); |
| 12016 } | 12063 } |
| 12017 DefinedType.prototype.resolve = function() { | 12064 DefinedType.prototype.resolve = function() { |
| 12018 if ((this.definition instanceof TypeDefinition)) { | 12065 if ((this.definition instanceof TypeDefinition)) { |
| 12019 var typeDef = this.definition; | 12066 var typeDef = this.definition; |
| 12020 if (this.isClass) { | 12067 if (this.isClass) { |
| 12021 if (typeDef.extendsTypes != null && typeDef.extendsTypes.get$length() > (0
)) { | 12068 if (typeDef.extendsTypes != null && typeDef.extendsTypes.get$length() > (0
)) { |
| 12022 if (typeDef.extendsTypes.get$length() > (1)) { | 12069 if (typeDef.extendsTypes.get$length() > (1)) { |
| 12023 $globals.world.error("more than one base class", typeDef.extendsTypes[
(1)].get$span()); | 12070 $globals.world.error("more than one base class", typeDef.extendsTypes.
$index((1)).get$span()); |
| 12024 } | 12071 } |
| 12025 var extendsTypeRef = typeDef.extendsTypes[(0)]; | 12072 var extendsTypeRef = typeDef.extendsTypes.$index((0)); |
| 12026 if ((extendsTypeRef instanceof GenericTypeReference)) { | 12073 if ((extendsTypeRef instanceof GenericTypeReference)) { |
| 12027 var g = extendsTypeRef; | 12074 var g = extendsTypeRef; |
| 12028 this.set$parent(this.resolveType$2(g.baseType, true)); | 12075 this.set$parent(this.resolveType(g.baseType, true)); |
| 12029 } | 12076 } |
| 12030 this.set$parent(this.resolveType$2(extendsTypeRef, true)); | 12077 this.set$parent(this.resolveType(extendsTypeRef, true)); |
| 12031 if (!this.get$parent().get$isClass()) { | 12078 if (!this.get$parent().get$isClass()) { |
| 12032 $globals.world.error("class may not extend an interface - use implemen
ts", typeDef.extendsTypes[(0)].get$span()); | 12079 $globals.world.error("class may not extend an interface - use implemen
ts", typeDef.extendsTypes.$index((0)).get$span()); |
| 12033 } | 12080 } |
| 12034 this.get$parent().addDirectSubtype$1(this); | 12081 this.get$parent().addDirectSubtype(this); |
| 12035 if (this._cycleInClassExtends()) { | 12082 if (this._cycleInClassExtends()) { |
| 12036 $globals.world.error(("class \"" + this.name + "\" has a cycle in its
inheritance chain"), extendsTypeRef.get$span()); | 12083 $globals.world.error(("class \"" + this.name + "\" has a cycle in its
inheritance chain"), extendsTypeRef.get$span()); |
| 12037 } | 12084 } |
| 12038 } | 12085 } |
| 12039 else { | 12086 else { |
| 12040 if (!this.get$isObject()) { | 12087 if (!this.get$isObject()) { |
| 12041 this.set$parent($globals.world.objectType); | 12088 this.set$parent($globals.world.objectType); |
| 12042 this.get$parent().addDirectSubtype$1(this); | 12089 this.get$parent().addDirectSubtype(this); |
| 12043 } | 12090 } |
| 12044 } | 12091 } |
| 12045 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); | 12092 this.interfaces = this._resolveInterfaces(typeDef.implementsTypes); |
| 12046 if (typeDef.defaultType != null) { | 12093 if (typeDef.defaultType != null) { |
| 12047 $globals.world.error("default not allowed on classes", typeDef.defaultTy
pe.span); | 12094 $globals.world.error("default not allowed on classes", typeDef.defaultTy
pe.span); |
| 12048 } | 12095 } |
| 12049 } | 12096 } |
| 12050 else { | 12097 else { |
| 12051 if (typeDef.implementsTypes != null && typeDef.implementsTypes.get$length(
) > (0)) { | 12098 if (typeDef.implementsTypes != null && typeDef.implementsTypes.get$length(
) > (0)) { |
| 12052 $globals.world.error("implements not allowed on interfaces (use extends)
", typeDef.implementsTypes[(0)].get$span()); | 12099 $globals.world.error("implements not allowed on interfaces (use extends)
", typeDef.implementsTypes.$index((0)).get$span()); |
| 12053 } | 12100 } |
| 12054 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); | 12101 this.interfaces = this._resolveInterfaces(typeDef.extendsTypes); |
| 12055 var res = this._cycleInInterfaceExtends(); | 12102 var res = this._cycleInInterfaceExtends(); |
| 12056 if (res >= (0)) { | 12103 if (res >= (0)) { |
| 12057 $globals.world.error(("interface \"" + this.name + "\" has a cycle in it
s inheritance chain"), typeDef.extendsTypes[res].get$span()); | 12104 $globals.world.error(("interface \"" + this.name + "\" has a cycle in it
s inheritance chain"), typeDef.extendsTypes.$index(res).get$span()); |
| 12058 } | 12105 } |
| 12059 if (typeDef.defaultType != null) { | 12106 if (typeDef.defaultType != null) { |
| 12060 this.defaultType = this.resolveType$2(typeDef.defaultType.baseType, true
); | 12107 this.defaultType = this.resolveType(typeDef.defaultType.baseType, true); |
| 12061 if (this.defaultType == null) { | 12108 if (this.defaultType == null) { |
| 12062 $globals.world.warning("unresolved default class", typeDef.defaultType
.span); | 12109 $globals.world.warning("unresolved default class", typeDef.defaultType
.span); |
| 12063 } | 12110 } |
| 12064 else { | 12111 else { |
| 12065 this.defaultType._resolveTypeParams(typeDef.defaultType.typeParameters
); | 12112 this.defaultType._resolveTypeParams(typeDef.defaultType.typeParameters
); |
| 12066 } | 12113 } |
| 12067 } | 12114 } |
| 12068 } | 12115 } |
| 12069 } | 12116 } |
| 12070 else if ((this.definition instanceof FunctionTypeDefinition)) { | 12117 else if ((this.definition instanceof FunctionTypeDefinition)) { |
| 12071 this.interfaces = [$globals.world.functionType]; | 12118 this.interfaces = [$globals.world.functionType]; |
| 12072 } | 12119 } |
| 12073 this._resolveTypeParams(this.typeParameters); | 12120 this._resolveTypeParams(this.typeParameters); |
| 12074 if (this.get$isObject()) this._createNotEqualMember(); | 12121 if (this.get$isObject()) this._createNotEqualMember(); |
| 12075 $globals.world._addType(this); | 12122 $globals.world._addType(this); |
| 12076 var $$list = this.constructors.getValues(); | 12123 var $$list = this.constructors.getValues$0(); |
| 12077 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12124 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12078 var c = $$i.next$0(); | 12125 var c = $$i.next$0(); |
| 12079 c.resolve$0(); | 12126 c.resolve$0(); |
| 12080 } | 12127 } |
| 12081 var $$list = this.members.getValues(); | 12128 var $$list = this.members.getValues$0(); |
| 12082 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12129 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12083 var m = $$i.next$0(); | 12130 var m = $$i.next$0(); |
| 12084 m.resolve$0(); | 12131 m.resolve$0(); |
| 12085 } | 12132 } |
| 12086 this.factories.forEach((function (f) { | 12133 this.factories.forEach((function (f) { |
| 12087 return f.resolve$0(); | 12134 return f.resolve$0(); |
| 12088 }) | 12135 }) |
| 12089 ); | 12136 ); |
| 12090 if (this.get$isJsGlobalObject()) { | 12137 if (this.get$isJsGlobalObject()) { |
| 12091 var $$list = this.members.getValues(); | 12138 var $$list = this.members.getValues$0(); |
| 12092 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 12139 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 12093 var m = $$i.next$0(); | 12140 var m = $$i.next$0(); |
| 12094 if (!m.get$isStatic()) $globals.world._addTopName(m); | 12141 if (!m.get$isStatic()) $globals.world._addTopName(m); |
| 12095 } | 12142 } |
| 12096 } | 12143 } |
| 12097 } | 12144 } |
| 12098 DefinedType.prototype._resolveTypeParams = function(params) { | 12145 DefinedType.prototype._resolveTypeParams = function(params) { |
| 12099 if (params == null) return; | 12146 if (params == null) return; |
| 12100 for (var $$i = 0;$$i < params.get$length(); $$i++) { | 12147 for (var $$i = 0;$$i < params.get$length(); $$i++) { |
| 12101 var tp = params[$$i]; | 12148 var tp = params.$index($$i); |
| 12102 tp.set$enclosingElement(this); | 12149 tp.set$enclosingElement(this); |
| 12103 tp.resolve$0(); | 12150 tp.resolve$0(); |
| 12104 } | 12151 } |
| 12105 } | 12152 } |
| 12106 DefinedType.prototype.addMethod = function(methodName, definition) { | 12153 DefinedType.prototype.addMethod = function(methodName, definition) { |
| 12107 if (methodName == null) methodName = definition.name.name; | 12154 if (methodName == null) methodName = definition.name.name; |
| 12108 var method = new MethodMember(methodName, this, definition); | 12155 var method = new MethodMember(methodName, this, definition); |
| 12109 if (method.get$isConstructor()) { | 12156 if (method.get$isConstructor()) { |
| 12110 if (this.constructors.containsKey(method.get$constructorName())) { | 12157 if (this.constructors.containsKey(method.get$constructorName())) { |
| 12111 $globals.world.error(("duplicate constructor definition of " + method.get$
name()), definition.span); | 12158 $globals.world.error(("duplicate constructor definition of " + method.get$
name()), definition.span); |
| 12112 return; | 12159 return; |
| 12113 } | 12160 } |
| 12114 this.constructors.$setindex(method.get$constructorName(), method); | 12161 this.constructors.$setindex(method.get$constructorName(), method); |
| 12115 return; | 12162 return; |
| 12116 } | 12163 } |
| 12117 if (definition.modifiers != null && definition.modifiers.get$length() == (1) &
& $eq(definition.modifiers[(0)].get$kind(), (74))) { | 12164 if (definition.modifiers != null && definition.modifiers.get$length() == (1) &
& $eq(definition.modifiers.$index((0)).get$kind(), (74))) { |
| 12118 if (this.factories.getFactory(method.get$constructorName(), method.get$name(
)) != null) { | 12165 if (this.factories.getFactory(method.get$constructorName(), method.get$name(
)) != null) { |
| 12119 $globals.world.error(("duplicate factory definition of \"" + method.get$na
me() + "\""), definition.span); | 12166 $globals.world.error(("duplicate factory definition of \"" + method.get$na
me() + "\""), definition.span); |
| 12120 return; | 12167 return; |
| 12121 } | 12168 } |
| 12122 this.factories.addFactory(method.get$constructorName(), method.get$name(), m
ethod); | 12169 this.factories.addFactory(method.get$constructorName(), method.get$name(), m
ethod); |
| 12123 return; | 12170 return; |
| 12124 } | 12171 } |
| 12125 if (methodName.startsWith("get:") || methodName.startsWith("set:")) { | 12172 if (methodName.startsWith("get:") || methodName.startsWith("set:")) { |
| 12126 var propName = methodName.substring((4)); | 12173 var propName = methodName.substring((4)); |
| 12127 var prop = this.members.$index(propName); | 12174 var prop = this.members.$index(propName); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 12149 } | 12196 } |
| 12150 if (this.members.containsKey(methodName)) { | 12197 if (this.members.containsKey(methodName)) { |
| 12151 $globals.world.error(("duplicate method definition of \"" + method.get$name(
) + "\""), definition.span); | 12198 $globals.world.error(("duplicate method definition of \"" + method.get$name(
) + "\""), definition.span); |
| 12152 return; | 12199 return; |
| 12153 } | 12200 } |
| 12154 this.members.$setindex(methodName, method); | 12201 this.members.$setindex(methodName, method); |
| 12155 } | 12202 } |
| 12156 DefinedType.prototype.addField = function(definition) { | 12203 DefinedType.prototype.addField = function(definition) { |
| 12157 for (var i = (0); | 12204 for (var i = (0); |
| 12158 i < definition.names.get$length(); i++) { | 12205 i < definition.names.get$length(); i++) { |
| 12159 var name = definition.names[i].get$name(); | 12206 var name = definition.names.$index(i).get$name(); |
| 12160 if (this.members.containsKey(name)) { | 12207 if (this.members.containsKey(name)) { |
| 12161 $globals.world.error(("duplicate field definition of \"" + name + "\""), d
efinition.span); | 12208 $globals.world.error(("duplicate field definition of \"" + name + "\""), d
efinition.span); |
| 12162 return; | 12209 return; |
| 12163 } | 12210 } |
| 12164 var value = null; | 12211 var value = null; |
| 12165 if (definition.values != null) { | 12212 if (definition.values != null) { |
| 12166 value = definition.values[i]; | 12213 value = definition.values.$index(i); |
| 12167 } | 12214 } |
| 12168 var field = new FieldMember(name, this, definition, value); | 12215 var field = new FieldMember(name, this, definition, value); |
| 12169 this.members.$setindex(name, field); | 12216 this.members.$setindex(name, field); |
| 12170 if (this.isNative) { | 12217 if (this.isNative) { |
| 12171 field.set$isNative(true); | 12218 field.set$isNative(true); |
| 12172 } | 12219 } |
| 12173 } | 12220 } |
| 12174 } | 12221 } |
| 12175 DefinedType.prototype.getFactory = function(type, constructorName) { | 12222 DefinedType.prototype.getFactory = function(type, constructorName) { |
| 12176 var ret = this.factories.getFactory(type.name, constructorName); | 12223 var ret = this.factories.getFactory(type.name, constructorName); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 12195 return this._tryCreateDefaultConstructor(constructorName); | 12242 return this._tryCreateDefaultConstructor(constructorName); |
| 12196 } | 12243 } |
| 12197 DefinedType.prototype._checkDefaultTypeParams = function() { | 12244 DefinedType.prototype._checkDefaultTypeParams = function() { |
| 12198 function toList(list) { | 12245 function toList(list) { |
| 12199 return (list != null ? list : const$0008); | 12246 return (list != null ? list : const$0008); |
| 12200 } | 12247 } |
| 12201 var typeDef = this.definition; | 12248 var typeDef = this.definition; |
| 12202 if (typeDef.defaultType.oldFactory) { | 12249 if (typeDef.defaultType.oldFactory) { |
| 12203 return; | 12250 return; |
| 12204 } | 12251 } |
| 12205 var interfaceParams = toList.call$1(this.typeParameters); | 12252 var interfaceParams = toList(this.typeParameters); |
| 12206 var defaultParams = toList.call$1(typeDef.defaultType.typeParameters); | 12253 var defaultParams = toList(typeDef.defaultType.typeParameters); |
| 12207 var classParams = toList.call$1(this.defaultType.typeParameters); | 12254 var classParams = toList(this.defaultType.typeParameters); |
| 12208 if ($ne(interfaceParams.get$length(), defaultParams.get$length()) || $ne(defau
ltParams.get$length(), classParams.get$length())) { | 12255 if ($ne(interfaceParams.get$length(), defaultParams.get$length()) || $ne(defau
ltParams.get$length(), classParams.get$length())) { |
| 12209 $globals.world.error("\"default\" must have the same number of type paramete
rs as the class and interface do", this.get$span(), typeDef.defaultType.span, th
is.defaultType.get$span()); | 12256 $globals.world.error("\"default\" must have the same number of type paramete
rs as the class and interface do", this.get$span(), typeDef.defaultType.span, th
is.defaultType.get$span()); |
| 12210 return; | 12257 return; |
| 12211 } | 12258 } |
| 12212 for (var i = (0); | 12259 for (var i = (0); |
| 12213 i < interfaceParams.get$length(); i++) { | 12260 i < interfaceParams.get$length(); i++) { |
| 12214 var ip = interfaceParams.$index(i); | 12261 var ip = interfaceParams.$index(i); |
| 12215 var dp = defaultParams.$index(i); | 12262 var dp = defaultParams.$index(i); |
| 12216 var cp = classParams.$index(i); | 12263 var cp = classParams.$index(i); |
| 12217 dp.resolve$0(); | 12264 dp.resolve$0(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 12240 } | 12287 } |
| 12241 var typeDef = this.definition; | 12288 var typeDef = this.definition; |
| 12242 var c = new FunctionDefinition(null, null, typeDef.name, [], inits, native_,
body, span); | 12289 var c = new FunctionDefinition(null, null, typeDef.name, [], inits, native_,
body, span); |
| 12243 this.addMethod(null, c); | 12290 this.addMethod(null, c); |
| 12244 this.constructors.$index("").resolve$0(); | 12291 this.constructors.$index("").resolve$0(); |
| 12245 return this.constructors.$index(""); | 12292 return this.constructors.$index(""); |
| 12246 } | 12293 } |
| 12247 return null; | 12294 return null; |
| 12248 } | 12295 } |
| 12249 DefinedType.prototype.getMember = function(memberName) { | 12296 DefinedType.prototype.getMember = function(memberName) { |
| 12250 var member = this._foundMembers.$index(memberName); | 12297 var member = this.members.$index(memberName); |
| 12251 if (member != null) return member; | |
| 12252 member = this.members.$index(memberName); | |
| 12253 if (member != null) { | 12298 if (member != null) { |
| 12254 this._checkOverride(member); | 12299 this._checkOverride(member); |
| 12255 this._foundMembers.$setindex(memberName, member); | |
| 12256 return member; | 12300 return member; |
| 12257 } | 12301 } |
| 12258 if (this.get$isTop()) { | 12302 if (this.get$isTop()) { |
| 12259 var libType = this.library.findTypeByName(memberName); | 12303 var libType = this.library.findTypeByName(memberName); |
| 12260 if (libType != null) { | 12304 if (libType != null) { |
| 12261 member = libType.get$typeMember(); | 12305 return libType.get$typeMember(); |
| 12262 this._foundMembers.$setindex(memberName, member); | |
| 12263 return member; | |
| 12264 } | 12306 } |
| 12265 } | 12307 } |
| 12266 member = this._getMemberInParents(memberName); | 12308 return this._getMemberInParents(memberName); |
| 12267 this._foundMembers.$setindex(memberName, member); | |
| 12268 return member; | |
| 12269 } | 12309 } |
| 12270 DefinedType.prototype.resolveTypeParams = function(inType) { | 12310 DefinedType.prototype.resolveTypeParams = function(inType) { |
| 12271 return this; | 12311 return this; |
| 12272 } | 12312 } |
| 12273 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { | 12313 DefinedType.prototype.getOrMakeConcreteType = function(typeArgs) { |
| 12274 var jsnames = []; | 12314 var jsnames = []; |
| 12275 var names = []; | 12315 var names = []; |
| 12276 var typeMap = new HashMapImplementation(); | 12316 var typeMap = new HashMapImplementation(); |
| 12277 for (var i = (0); | 12317 for (var i = (0); |
| 12278 i < typeArgs.get$length(); i++) { | 12318 i < typeArgs.get$length(); i++) { |
| 12279 var paramName = this.typeParameters[i].get$name(); | 12319 var paramName = this.typeParameters.$index(i).get$name(); |
| 12280 typeMap.$setindex(paramName, typeArgs[i]); | 12320 typeMap.$setindex(paramName, typeArgs.$index(i)); |
| 12281 names.add$1(typeArgs[i].get$name()); | 12321 names.add$1(typeArgs.$index(i).get$name()); |
| 12282 jsnames.add$1(typeArgs[i].get$jsname()); | 12322 jsnames.add$1(typeArgs.$index(i).get$jsname()); |
| 12283 } | 12323 } |
| 12284 var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$")); | 12324 var jsname = ("" + this.get$jsname() + "_" + Strings.join(jsnames, "$")); |
| 12285 var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">"); | 12325 var simpleName = ("" + this.name + "<" + Strings.join(names, ", ") + ">"); |
| 12286 var key = Strings.join(names, "$"); | 12326 var key = Strings.join(names, "$"); |
| 12287 var ret = this._concreteTypes.$index(key); | 12327 var ret = this._concreteTypes.$index(key); |
| 12288 if (ret == null) { | 12328 if (ret == null) { |
| 12289 ret = new ConcreteType(simpleName, this, typeMap, typeArgs); | 12329 ret = new ConcreteType(simpleName, this, typeMap, typeArgs); |
| 12290 ret.set$_jsname(jsname); | 12330 ret.set$_jsname(jsname); |
| 12291 this._concreteTypes.$setindex(key, ret); | 12331 this._concreteTypes.$setindex(key, ret); |
| 12292 } | 12332 } |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12355 } | 12395 } |
| 12356 FixedCollection.prototype.every = function(f) { | 12396 FixedCollection.prototype.every = function(f) { |
| 12357 return Collections.every(this, f); | 12397 return Collections.every(this, f); |
| 12358 } | 12398 } |
| 12359 FixedCollection.prototype.some = function(f) { | 12399 FixedCollection.prototype.some = function(f) { |
| 12360 return Collections.some(this, f); | 12400 return Collections.some(this, f); |
| 12361 } | 12401 } |
| 12362 FixedCollection.prototype.isEmpty = function() { | 12402 FixedCollection.prototype.isEmpty = function() { |
| 12363 return this.length == (0); | 12403 return this.length == (0); |
| 12364 } | 12404 } |
| 12405 FixedCollection.prototype.every$1 = function($0) { |
| 12406 return this.every(to$call$1($0)); |
| 12407 }; |
| 12365 FixedCollection.prototype.filter$1 = function($0) { | 12408 FixedCollection.prototype.filter$1 = function($0) { |
| 12366 return this.filter(to$call$1($0)); | 12409 return this.filter(to$call$1($0)); |
| 12367 }; | 12410 }; |
| 12368 FixedCollection.prototype.forEach$1 = function($0) { | 12411 FixedCollection.prototype.forEach$1 = function($0) { |
| 12369 return this.forEach(to$call$1($0)); | 12412 return this.forEach(to$call$1($0)); |
| 12370 }; | 12413 }; |
| 12371 FixedCollection.prototype.isEmpty$0 = FixedCollection.prototype.isEmpty; | 12414 FixedCollection.prototype.isEmpty$0 = FixedCollection.prototype.isEmpty; |
| 12372 FixedCollection.prototype.iterator$0 = FixedCollection.prototype.iterator; | 12415 FixedCollection.prototype.iterator$0 = FixedCollection.prototype.iterator; |
| 12416 FixedCollection.prototype.some$1 = function($0) { |
| 12417 return this.some(to$call$1($0)); |
| 12418 }; |
| 12373 // ********** Code for FixedCollection_Type ************** | 12419 // ********** Code for FixedCollection_Type ************** |
| 12374 $inherits(FixedCollection_Type, FixedCollection); | 12420 $inherits(FixedCollection_Type, FixedCollection); |
| 12375 function FixedCollection_Type(value, length) { | 12421 function FixedCollection_Type(value, length) { |
| 12376 this.value = value; | 12422 this.value = value; |
| 12377 this.length = length; | 12423 this.length = length; |
| 12378 } | 12424 } |
| 12379 // ********** Code for FixedIterator ************** | 12425 // ********** Code for FixedIterator ************** |
| 12380 function FixedIterator(value, length) { | 12426 function FixedIterator(value, length) { |
| 12381 this.length = length; | 12427 this.length = length; |
| 12382 this._index = (0); | 12428 this._index = (0); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12489 CopyOnWriteMap.prototype.containsKey = function(key) { | 12535 CopyOnWriteMap.prototype.containsKey = function(key) { |
| 12490 return this._lang_map.containsKey(key); | 12536 return this._lang_map.containsKey(key); |
| 12491 } | 12537 } |
| 12492 CopyOnWriteMap.prototype.containsKey$1 = CopyOnWriteMap.prototype.containsKey; | 12538 CopyOnWriteMap.prototype.containsKey$1 = CopyOnWriteMap.prototype.containsKey; |
| 12493 CopyOnWriteMap.prototype.forEach$1 = function($0) { | 12539 CopyOnWriteMap.prototype.forEach$1 = function($0) { |
| 12494 return this.forEach(to$call$2($0)); | 12540 return this.forEach(to$call$2($0)); |
| 12495 }; | 12541 }; |
| 12496 CopyOnWriteMap.prototype.getKeys$0 = CopyOnWriteMap.prototype.getKeys; | 12542 CopyOnWriteMap.prototype.getKeys$0 = CopyOnWriteMap.prototype.getKeys; |
| 12497 CopyOnWriteMap.prototype.getValues$0 = CopyOnWriteMap.prototype.getValues; | 12543 CopyOnWriteMap.prototype.getValues$0 = CopyOnWriteMap.prototype.getValues; |
| 12498 CopyOnWriteMap.prototype.isEmpty$0 = CopyOnWriteMap.prototype.isEmpty; | 12544 CopyOnWriteMap.prototype.isEmpty$0 = CopyOnWriteMap.prototype.isEmpty; |
| 12545 CopyOnWriteMap.prototype.putIfAbsent$2 = function($0, $1) { |
| 12546 return this.putIfAbsent($0, to$call$0($1)); |
| 12547 }; |
| 12499 // ********** Code for CopyOnWriteMap_K$V ************** | 12548 // ********** Code for CopyOnWriteMap_K$V ************** |
| 12500 $inherits(CopyOnWriteMap_K$V, CopyOnWriteMap); | 12549 $inherits(CopyOnWriteMap_K$V, CopyOnWriteMap); |
| 12501 function CopyOnWriteMap_K$V() {} | 12550 function CopyOnWriteMap_K$V() {} |
| 12502 CopyOnWriteMap_K$V._wrap$ctor = function(_map) { | 12551 CopyOnWriteMap_K$V._wrap$ctor = function(_map) { |
| 12503 this._lang_map = _map; | 12552 this._lang_map = _map; |
| 12504 } | 12553 } |
| 12505 CopyOnWriteMap_K$V._wrap$ctor.prototype = CopyOnWriteMap_K$V.prototype; | 12554 CopyOnWriteMap_K$V._wrap$ctor.prototype = CopyOnWriteMap_K$V.prototype; |
| 12506 // ********** Code for CopyOnWriteMap_dart_core_String$VariableValue ***********
*** | 12555 // ********** Code for CopyOnWriteMap_dart_core_String$VariableValue ***********
*** |
| 12507 $inherits(CopyOnWriteMap_dart_core_String$VariableValue, CopyOnWriteMap); | 12556 $inherits(CopyOnWriteMap_dart_core_String$VariableValue, CopyOnWriteMap); |
| 12508 function CopyOnWriteMap_dart_core_String$VariableValue() { | 12557 function CopyOnWriteMap_dart_core_String$VariableValue() { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12556 } | 12605 } |
| 12557 Value.prototype.get$isFinal = function() { | 12606 Value.prototype.get$isFinal = function() { |
| 12558 return false; | 12607 return false; |
| 12559 } | 12608 } |
| 12560 Value.prototype.get$needsTemp = function() { | 12609 Value.prototype.get$needsTemp = function() { |
| 12561 return true; | 12610 return true; |
| 12562 } | 12611 } |
| 12563 Value.prototype.get$staticType = function() { | 12612 Value.prototype.get$staticType = function() { |
| 12564 return this.get$type(); | 12613 return this.get$type(); |
| 12565 } | 12614 } |
| 12566 Value.comma = function(x, y) { | |
| 12567 return new Value(y.get$type(), ("(" + x.get$code() + ", " + y.get$code() + ")"
), null); | |
| 12568 } | |
| 12569 Value.union = function(x, y) { | 12615 Value.union = function(x, y) { |
| 12570 if (y == null || $eq(x, y)) return x; | 12616 if (y == null || $eq(x, y)) return x; |
| 12571 if (x == null) return y; | 12617 if (x == null) return y; |
| 12572 var ret = x._tryUnion(y); | 12618 var ret = x._tryUnion(y); |
| 12573 if (ret != null) return ret; | 12619 if (ret != null) return ret; |
| 12574 ret = y._tryUnion(x); | 12620 ret = y._tryUnion(x); |
| 12575 if (ret != null) return ret; | 12621 if (ret != null) return ret; |
| 12576 return new Value(Type.union(x.get$type(), y.get$type()), null, null); | 12622 return new Value(Type.union(x.get$type(), y.get$type()), null, null); |
| 12577 } | 12623 } |
| 12578 Value.prototype._tryUnion = function(right) { | 12624 Value.prototype._tryUnion = function(right) { |
| 12579 return null; | 12625 return null; |
| 12580 } | 12626 } |
| 12581 Value.prototype.validateInitialized = function(span) { | 12627 Value.prototype.validateInitialized = function(span) { |
| 12582 | 12628 |
| 12583 } | 12629 } |
| 12584 Value.prototype.get_ = function(context, name, node) { | 12630 Value.prototype.get_ = function(context, name, node) { |
| 12585 var member = this._resolveMember(context, name, node, false); | 12631 var member = this._resolveMember(context, name, node, false); |
| 12586 if (member != null) { | 12632 if (member != null) { |
| 12587 return member._get$3(context, node, this); | 12633 return member._get$3(context, node, this); |
| 12588 } | 12634 } |
| 12589 else { | 12635 else { |
| 12590 return this.invokeNoSuchMethod(context, ("get:" + name), node); | 12636 return this.invokeNoSuchMethod(context, ("get:" + name), node); |
| 12591 } | 12637 } |
| 12592 } | 12638 } |
| 12593 Value.prototype.set_ = function(context, name, node, value, isDynamic, kind, ret
urnKind) { | 12639 Value.prototype.set_ = function(context, name, node, value, isDynamic) { |
| 12594 var member = this._resolveMember(context, name, node, isDynamic); | 12640 var member = this._resolveMember(context, name, node, isDynamic); |
| 12595 if (member != null) { | 12641 if (member != null) { |
| 12596 var thisValue = this; | 12642 return member._set$5(context, node, this, value, isDynamic); |
| 12597 var thisTmp = null; | |
| 12598 var retTmp = null; | |
| 12599 if (kind != (0)) { | |
| 12600 thisTmp = context.getTemp(thisValue); | |
| 12601 thisValue = context.assignTemp(thisTmp, thisValue); | |
| 12602 var lhs = member._get$3(context, node, thisTmp); | |
| 12603 if (returnKind == (3)) { | |
| 12604 retTmp = context.forceTemp(lhs); | |
| 12605 lhs = context.assignTemp(retTmp, lhs); | |
| 12606 } | |
| 12607 value = lhs.binop$4(kind, value, context, node); | |
| 12608 } | |
| 12609 if (returnKind == (2)) { | |
| 12610 retTmp = context.forceTemp(value); | |
| 12611 value = context.assignTemp(retTmp, value); | |
| 12612 } | |
| 12613 var ret = member._set$5(context, node, thisValue, value, isDynamic); | |
| 12614 if (thisTmp != null && $ne(thisTmp, this)) context.freeTemp(thisTmp); | |
| 12615 if (retTmp != null) { | |
| 12616 context.freeTemp(retTmp); | |
| 12617 return Value.comma(ret, retTmp); | |
| 12618 } | |
| 12619 else { | |
| 12620 return ret; | |
| 12621 } | |
| 12622 } | 12643 } |
| 12623 else { | 12644 else { |
| 12624 return this.invokeNoSuchMethod(context, ("set:" + name), node, new Arguments
(null, [value])); | 12645 return this.invokeNoSuchMethod(context, ("set:" + name), node, new Arguments
(null, [value])); |
| 12625 } | 12646 } |
| 12626 } | 12647 } |
| 12627 Value.prototype.setIndex = function(context, index, node, value, isDynamic, kind
, returnKind) { | |
| 12628 var member = this._resolveMember(context, ":setindex", node, isDynamic); | |
| 12629 if (member != null) { | |
| 12630 var thisValue = this; | |
| 12631 var indexValue = index; | |
| 12632 var thisTmp = null; | |
| 12633 var indexTmp = null; | |
| 12634 var retTmp = null; | |
| 12635 if (returnKind == (2)) { | |
| 12636 retTmp = context.forceTemp(value); | |
| 12637 } | |
| 12638 if (kind != (0)) { | |
| 12639 thisTmp = context.getTemp(this); | |
| 12640 indexTmp = context.getTemp(index); | |
| 12641 thisValue = context.assignTemp(thisTmp, thisValue); | |
| 12642 indexValue = context.assignTemp(indexTmp, indexValue); | |
| 12643 if (returnKind == (3)) { | |
| 12644 retTmp = context.forceTemp(value); | |
| 12645 } | |
| 12646 var lhs = thisTmp.invoke$4(context, ":index", node, new Arguments(null, [i
ndexTmp])); | |
| 12647 if (returnKind == (3)) { | |
| 12648 lhs = context.assignTemp(retTmp, lhs); | |
| 12649 } | |
| 12650 value = lhs.binop$4(kind, value, context, node); | |
| 12651 } | |
| 12652 if (returnKind == (2)) { | |
| 12653 value = context.assignTemp(retTmp, value); | |
| 12654 } | |
| 12655 var ret = member.invoke$5(context, node, thisValue, new Arguments(null, [ind
exValue, value]), isDynamic); | |
| 12656 if (thisTmp != null && $ne(thisTmp, this)) context.freeTemp(thisTmp); | |
| 12657 if (indexTmp != null && $ne(indexTmp, index)) context.freeTemp(indexTmp); | |
| 12658 if (retTmp != null) { | |
| 12659 context.freeTemp(retTmp); | |
| 12660 return Value.comma(ret, retTmp); | |
| 12661 } | |
| 12662 else { | |
| 12663 return ret; | |
| 12664 } | |
| 12665 } | |
| 12666 else { | |
| 12667 return this.invokeNoSuchMethod(context, ":index", node, new Arguments(null,
[index, value])); | |
| 12668 } | |
| 12669 } | |
| 12670 Value.prototype.unop = function(kind, context, node) { | 12648 Value.prototype.unop = function(kind, context, node) { |
| 12671 switch (kind) { | 12649 switch (kind) { |
| 12672 case (19): | 12650 case (19): |
| 12673 | 12651 |
| 12674 var newVal = this.convertTo(context, $globals.world.nonNullBool, false); | 12652 var newVal = this.convertTo(context, $globals.world.nonNullBool, false); |
| 12675 return new Value(newVal.get$type(), ("!" + newVal.get$code()), node.get$sp
an()); | 12653 return new Value(newVal.get$type(), ("!" + newVal.get$code()), node.get$sp
an()); |
| 12676 | 12654 |
| 12677 case (42): | 12655 case (42): |
| 12678 | 12656 |
| 12679 $globals.world.error("no unary add operator in dart", node.get$span()); | 12657 $globals.world.error("no unary add operator in dart", node.get$span()); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12728 } | 12706 } |
| 12729 } | 12707 } |
| 12730 Value.prototype.canInvoke = function(context, name, args) { | 12708 Value.prototype.canInvoke = function(context, name, args) { |
| 12731 if (this.get$type().get$isVarOrFunction() && name == ":call") { | 12709 if (this.get$type().get$isVarOrFunction() && name == ":call") { |
| 12732 return true; | 12710 return true; |
| 12733 } | 12711 } |
| 12734 var member = this._resolveMember(context, name, null, true); | 12712 var member = this._resolveMember(context, name, null, true); |
| 12735 return member != null && member.canInvoke$2(context, args); | 12713 return member != null && member.canInvoke$2(context, args); |
| 12736 } | 12714 } |
| 12737 Value.prototype._hasOverriddenNoSuchMethod = function() { | 12715 Value.prototype._hasOverriddenNoSuchMethod = function() { |
| 12738 var m = this.get$type().getMember("noSuchMethod"); | 12716 if (this.get$isSuper()) { |
| 12739 return m != null && !m.get$declaringType().get$isObject(); | 12717 var m = this.get$staticType().getMember("noSuchMethod"); |
| 12740 } | 12718 return m != null && !m.get$declaringType().get$isObject(); |
| 12741 Value.prototype.get$isPreciseType = function() { | |
| 12742 return this.get$isSuper() || this.get$isType(); | |
| 12743 } | |
| 12744 Value.prototype._missingMemberError = function(context, name, isDynamic, node) { | |
| 12745 var onStaticType = false; | |
| 12746 if ($ne(this.get$type(), this.get$staticType())) { | |
| 12747 onStaticType = this.get$staticType().getMember(name) != null; | |
| 12748 } | 12719 } |
| 12749 if (!onStaticType && !isDynamic && !this._isVarOrParameterType(this.get$static
Type()) && !this._hasOverriddenNoSuchMethod()) { | 12720 else { |
| 12750 var typeName = this.get$staticType().name; | 12721 var m = this.get$staticType().resolveMember("noSuchMethod"); |
| 12751 if (typeName == null) typeName = this.get$staticType().get$library().name; | 12722 return m != null && m.get$members().get$length() > (1); |
| 12752 var message = ("can not resolve \"" + name + "\" on \"" + typeName + "\""); | |
| 12753 if (this.get$isType()) { | |
| 12754 $globals.world.error(message, node.span); | |
| 12755 } | |
| 12756 else { | |
| 12757 $globals.world.warning(message, node.span); | |
| 12758 } | |
| 12759 } | 12723 } |
| 12760 } | 12724 } |
| 12761 Value.prototype._tryResolveMember = function(context, name, isDynamic, node) { | 12725 Value.prototype._tryResolveMember = function(context, resolvetype, name) { |
| 12762 var member = this.get$type().getMember(name); | 12726 if (this.get$isSuper()) { |
| 12763 if (member == null) { | 12727 return resolvetype.getMember(name); |
| 12764 this._missingMemberError(context, name, isDynamic, node); | |
| 12765 return null; | |
| 12766 } | 12728 } |
| 12767 else { | 12729 else { |
| 12768 if (this.get$isType() && !member.get$isStatic()) { | 12730 return resolvetype.resolveMember(name); |
| 12769 if (!isDynamic) { | |
| 12770 $globals.world.error("can not refer to instance member as static", node.
span); | |
| 12771 } | |
| 12772 return null; | |
| 12773 } | |
| 12774 } | |
| 12775 if (this.get$isPreciseType() || member.get$isStatic()) { | |
| 12776 return member.get$preciseMemberSet(); | |
| 12777 } | |
| 12778 else { | |
| 12779 return member.get$potentialMemberSet(); | |
| 12780 } | 12731 } |
| 12781 } | 12732 } |
| 12782 Value.prototype._isVarOrParameterType = function(t) { | 12733 Value.prototype._isVarOrParameterType = function(t) { |
| 12783 return t.get$isVar() || (t instanceof ParameterType); | 12734 return t.get$isVar() || (t instanceof ParameterType); |
| 12784 } | 12735 } |
| 12785 Value.prototype._shouldBindDynamically = function() { | 12736 Value.prototype._shouldBindDynamically = function() { |
| 12786 return this._isVarOrParameterType(this.get$type()) || $globals.options.forceDy
namic && !this.get$isConst(); | 12737 return this._isVarOrParameterType(this.get$type()) || $globals.options.forceDy
namic && !this.get$isConst(); |
| 12787 } | 12738 } |
| 12788 Value.prototype._resolveMember = function(context, name, node, isDynamic) { | 12739 Value.prototype._resolveMember = function(context, name, node, isDynamic) { |
| 12789 var member = null; | 12740 var member; |
| 12790 if (!this._shouldBindDynamically()) { | 12741 if (!this._shouldBindDynamically()) { |
| 12791 member = this._tryResolveMember(context, name, isDynamic, node); | 12742 member = this._tryResolveMember(context, this.get$type(), name); |
| 12743 if (member == null && $ne(this.get$type(), this.get$staticType())) { |
| 12744 member = this._tryResolveMember(context, this.get$staticType(), name); |
| 12745 } |
| 12746 if (member != null && this.get$isType() && !member.get$isStatic()) { |
| 12747 if (!isDynamic) { |
| 12748 $globals.world.error("can not refer to instance member as static", node.
span); |
| 12749 } |
| 12750 return null; |
| 12751 } |
| 12752 if (member == null && !isDynamic && !this._isVarOrParameterType(this.get$sta
ticType()) && !this._hasOverriddenNoSuchMethod()) { |
| 12753 var typeName = this.get$staticType().name; |
| 12754 if (typeName == null) typeName = this.get$staticType().get$library().name; |
| 12755 var message = ("can not resolve \"" + name + "\" on \"" + typeName + "\"")
; |
| 12756 if (this.get$isType()) { |
| 12757 $globals.world.error(message, node.span); |
| 12758 } |
| 12759 else { |
| 12760 $globals.world.warning(message, node.span); |
| 12761 } |
| 12762 } |
| 12792 } | 12763 } |
| 12793 if (member == null && !this.get$isSuper() && !this.get$isType()) { | 12764 if (member == null && !this.get$isSuper() && !this.get$isType()) { |
| 12794 member = context.findMembers(name); | 12765 member = context.findMembers(name); |
| 12795 if (member == null && !isDynamic) { | 12766 if (member == null && !isDynamic) { |
| 12796 var where = "the world"; | 12767 var where = "the world"; |
| 12797 if (name.startsWith("_")) { | 12768 if (name.startsWith("_")) { |
| 12798 where = ("library \"" + context.get$library().name + "\""); | 12769 where = ("library \"" + context.get$library().name + "\""); |
| 12799 } | 12770 } |
| 12800 $globals.world.warning(("" + name + " is not defined anywhere in " + where
+ "."), node.span); | 12771 $globals.world.warning(("" + name + " is not defined anywhere in " + where
+ "."), node.span); |
| 12801 } | 12772 } |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12884 $globals.world.gen.corejs.useThrow = true; | 12855 $globals.world.gen.corejs.useThrow = true; |
| 12885 return ("$throw(" + result.get$code() + ")"); | 12856 return ("$throw(" + result.get$code() + ")"); |
| 12886 }) | 12857 }) |
| 12887 ); | 12858 ); |
| 12888 } | 12859 } |
| 12889 if (toType.get$isNum()) toType = $globals.world.numType; | 12860 if (toType.get$isNum()) toType = $globals.world.numType; |
| 12890 var check; | 12861 var check; |
| 12891 if (toType.get$isVoid()) { | 12862 if (toType.get$isVoid()) { |
| 12892 check = ("$assert_void(" + this.get$code() + ")"); | 12863 check = ("$assert_void(" + this.get$code() + ")"); |
| 12893 if (toType.typeCheckCode == null) { | 12864 if (toType.typeCheckCode == null) { |
| 12894 toType.typeCheckCode = ("function $assert_void(x) {\n if (x == null) retu
rn null;\n " + throwTypeError.call$1("x") + "\n}"); | 12865 toType.typeCheckCode = ("function $assert_void(x) {\n if (x == null) retu
rn null;\n " + throwTypeError("x") + "\n}"); |
| 12895 } | 12866 } |
| 12896 } | 12867 } |
| 12897 else if ($eq(toType, $globals.world.nonNullBool)) { | 12868 else if ($eq(toType, $globals.world.nonNullBool)) { |
| 12898 $globals.world.gen.corejs.useNotNullBool = true; | 12869 $globals.world.gen.corejs.useNotNullBool = true; |
| 12899 check = ("$notnull_bool(" + this.get$code() + ")"); | 12870 check = ("$notnull_bool(" + this.get$code() + ")"); |
| 12900 } | 12871 } |
| 12901 else if (toType.get$library().get$isCore() && toType.get$typeofName() != null)
{ | 12872 else if (toType.get$library().get$isCore() && toType.get$typeofName() != null)
{ |
| 12902 check = ("$assert_" + toType.name + "(" + this.get$code() + ")"); | 12873 check = ("$assert_" + toType.name + "(" + this.get$code() + ")"); |
| 12903 if (toType.typeCheckCode == null) { | 12874 if (toType.typeCheckCode == null) { |
| 12904 toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if (
x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n " +
throwTypeError.call$1("x") + "\n}"); | 12875 toType.typeCheckCode = ("function $assert_" + toType.name + "(x) {\n if (
x == null || typeof(x) == \"" + toType.get$typeofName() + "\") return x;\n " +
throwTypeError("x") + "\n}"); |
| 12905 } | 12876 } |
| 12906 } | 12877 } |
| 12907 else { | 12878 else { |
| 12908 toType.isChecked = true; | 12879 toType.isChecked = true; |
| 12909 var checkName = "assert$" + toType.get$jsname(); | 12880 var checkName = "assert$" + toType.get$jsname(); |
| 12910 var temp = context.getTemp(this); | 12881 var temp = context.getTemp(this); |
| 12911 check = ("(" + context.assignTemp(temp, this).get$code() + " == null ? null
:"); | 12882 check = ("(" + context.assignTemp(temp, this).get$code() + " == null ? null
:"); |
| 12912 check = check + (" " + temp.get$code() + "." + checkName + "())"); | 12883 check = check + (" " + temp.get$code() + "." + checkName + "())"); |
| 12913 if ($ne(this, temp)) context.freeTemp(temp); | 12884 if ($ne(this, temp)) context.freeTemp(temp); |
| 12914 $globals.world.objectType.varStubs.putIfAbsent(checkName, (function () { | 12885 $globals.world.objectType.varStubs.putIfAbsent$2(checkName, (function () { |
| 12915 return new VarMethodStub(checkName, null, Arguments.get$EMPTY(), throwType
Error.call$1("this")); | 12886 return new VarMethodStub(checkName, null, Arguments.get$EMPTY(), throwType
Error("this")); |
| 12916 }) | 12887 }) |
| 12917 ); | 12888 ); |
| 12918 } | 12889 } |
| 12919 context.counters.typeAsserts++; | 12890 context.counters.typeAsserts++; |
| 12920 return new Value(toType, check, this.span); | 12891 return new Value(toType, check, this.span); |
| 12921 } | 12892 } |
| 12922 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck)
{ | 12893 Value.prototype.instanceOf = function(context, toType, span, isTrue, forceCheck)
{ |
| 12923 if (toType.get$isVar()) { | 12894 if (toType.get$isVar()) { |
| 12924 $globals.world.error("can not resolve type", span); | 12895 $globals.world.error("can not resolve type", span); |
| 12925 } | 12896 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12961 if (!$globals.world.objectType.varStubs.containsKey(checkName)) { | 12932 if (!$globals.world.objectType.varStubs.containsKey(checkName)) { |
| 12962 $globals.world.objectType.varStubs.$setindex(checkName, new VarMethodStub(
checkName, null, Arguments.get$EMPTY(), "return false")); | 12933 $globals.world.objectType.varStubs.$setindex(checkName, new VarMethodStub(
checkName, null, Arguments.get$EMPTY(), "return false")); |
| 12963 } | 12934 } |
| 12964 } | 12935 } |
| 12965 return new Value($globals.world.nonNullBool, testCode, span); | 12936 return new Value($globals.world.nonNullBool, testCode, span); |
| 12966 } | 12937 } |
| 12967 Value.prototype.convertWarning = function(toType) { | 12938 Value.prototype.convertWarning = function(toType) { |
| 12968 $globals.world.warning(("type \"" + this.get$type().name + "\" is not assignab
le to \"" + toType.name + "\""), this.span); | 12939 $globals.world.warning(("type \"" + this.get$type().name + "\" is not assignab
le to \"" + toType.name + "\""), this.span); |
| 12969 } | 12940 } |
| 12970 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { | 12941 Value.prototype.invokeNoSuchMethod = function(context, name, node, args) { |
| 12971 if (this.get$isType()) { | |
| 12972 $globals.world.error(("member lookup failed for \"" + name + "\""), node.spa
n); | |
| 12973 } | |
| 12974 var pos = ""; | 12942 var pos = ""; |
| 12975 if (args != null) { | 12943 if (args != null) { |
| 12976 var argsCode = []; | 12944 var argsCode = []; |
| 12977 for (var i = (0); | 12945 for (var i = (0); |
| 12978 i < args.get$length(); i++) { | 12946 i < args.get$length(); i++) { |
| 12979 argsCode.add$1(args.values[i].get$code()); | 12947 argsCode.add$1(args.values.$index(i).get$code()); |
| 12980 } | 12948 } |
| 12981 pos = Strings.join(argsCode, ", "); | 12949 pos = Strings.join(argsCode, ", "); |
| 12982 } | 12950 } |
| 12983 var noSuchArgs = [new Value($globals.world.stringType, ("\"" + name + "\""), n
ode.span), new Value($globals.world.listType, ("[" + pos + "]"), node.span)]; | 12951 var noSuchArgs = [new Value($globals.world.stringType, ("\"" + name + "\""), n
ode.span), new Value($globals.world.listType, ("[" + pos + "]"), node.span)]; |
| 12984 return this._resolveMember(context, "noSuchMethod", node, false).invoke(contex
t, node, this, new Arguments(null, noSuchArgs), false); | 12952 return this._resolveMember(context, "noSuchMethod", node, false).invoke$4(cont
ext, node, this, new Arguments(null, noSuchArgs)); |
| 12985 } | 12953 } |
| 12986 Value.fromBool = function(value, span) { | 12954 Value.fromBool = function(value, span) { |
| 12987 return new BoolValue(value, true, span); | 12955 return new BoolValue(value, true, span); |
| 12988 } | 12956 } |
| 12989 Value.fromInt = function(value, span) { | 12957 Value.fromInt = function(value, span) { |
| 12990 return new IntValue(value, true, span); | 12958 return new IntValue(value, true, span); |
| 12991 } | 12959 } |
| 12992 Value.fromDouble = function(value, span) { | 12960 Value.fromDouble = function(value, span) { |
| 12993 return new DoubleValue(value, true, span); | 12961 return new DoubleValue(value, true, span); |
| 12994 } | 12962 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 13009 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { | 12977 Value.prototype.instanceOf$4 = function($0, $1, $2, $3) { |
| 13010 return this.instanceOf($0, $1, $2, $3, false); | 12978 return this.instanceOf($0, $1, $2, $3, false); |
| 13011 }; | 12979 }; |
| 13012 Value.prototype.invoke$4 = function($0, $1, $2, $3) { | 12980 Value.prototype.invoke$4 = function($0, $1, $2, $3) { |
| 13013 return this.invoke($0, $1, $2, $3, false); | 12981 return this.invoke($0, $1, $2, $3, false); |
| 13014 }; | 12982 }; |
| 13015 Value.prototype.invoke$4$isDynamic = Value.prototype.invoke; | 12983 Value.prototype.invoke$4$isDynamic = Value.prototype.invoke; |
| 13016 Value.prototype.invoke$5 = Value.prototype.invoke; | 12984 Value.prototype.invoke$5 = Value.prototype.invoke; |
| 13017 Value.prototype.invokeNoSuchMethod$4 = Value.prototype.invokeNoSuchMethod; | 12985 Value.prototype.invokeNoSuchMethod$4 = Value.prototype.invokeNoSuchMethod; |
| 13018 Value.prototype.needsConversion$1 = Value.prototype.needsConversion; | 12986 Value.prototype.needsConversion$1 = Value.prototype.needsConversion; |
| 13019 Value.prototype.setIndex$4$kind$returnKind = function($0, $1, $2, $3, kind, retu
rnKind) { | 12987 Value.prototype.set_$4 = function($0, $1, $2, $3) { |
| 13020 return this.setIndex($0, $1, $2, $3, false, kind, returnKind); | 12988 return this.set_($0, $1, $2, $3, false); |
| 13021 }; | |
| 13022 Value.prototype.set_$4$kind$returnKind = function($0, $1, $2, $3, kind, returnKi
nd) { | |
| 13023 return this.set_($0, $1, $2, $3, false, kind, returnKind); | |
| 13024 }; | 12989 }; |
| 13025 Value.prototype.unop$3 = Value.prototype.unop; | 12990 Value.prototype.unop$3 = Value.prototype.unop; |
| 13026 // ********** Code for EvaluatedValue ************** | 12991 // ********** Code for EvaluatedValue ************** |
| 13027 $inherits(EvaluatedValue, Value); | 12992 $inherits(EvaluatedValue, Value); |
| 13028 function EvaluatedValue(isConst, type, span) { | 12993 function EvaluatedValue(isConst, type, span) { |
| 13029 this.isConst = isConst; | 12994 this.isConst = isConst; |
| 13030 Value.call(this, type, "@@@", span); | 12995 Value.call(this, type, "@@@", span); |
| 13031 } | 12996 } |
| 13032 EvaluatedValue.prototype.get$isConst = function() { return this.isConst; }; | 12997 EvaluatedValue.prototype.get$isConst = function() { return this.isConst; }; |
| 13033 EvaluatedValue.prototype.get$code = function() { | 12998 EvaluatedValue.prototype.get$code = function() { |
| 13034 $globals.world.internalError("Should not be getting code from raw EvaluatedVal
ue", this.span); | 12999 $globals.world.internalError("Should not be getting code from raw EvaluatedVal
ue", this.span); |
| 13035 } | 13000 } |
| 13036 EvaluatedValue.prototype.get$needsTemp = function() { | 13001 EvaluatedValue.prototype.get$needsTemp = function() { |
| 13037 return false; | 13002 return false; |
| 13038 } | 13003 } |
| 13039 EvaluatedValue.prototype.hashCode = function() { | 13004 EvaluatedValue.prototype.hashCode = function() { |
| 13040 return this.get$code().hashCode(); | 13005 return this.get$code().hashCode(); |
| 13041 } | 13006 } |
| 13042 EvaluatedValue.prototype.$eq = function(other) { | 13007 EvaluatedValue.prototype.$eq = function(other) { |
| 13043 return (other instanceof EvaluatedValue) && $eq(other.get$type(), this.get$typ
e()) && $eq(other.get$code(), this.get$code()); | 13008 return (other instanceof EvaluatedValue) && $eq(other.get$type(), this.type) &
& $eq(other.get$code(), this.get$code()); |
| 13044 } | 13009 } |
| 13045 EvaluatedValue.prototype.hashCode$0 = EvaluatedValue.prototype.hashCode; | 13010 EvaluatedValue.prototype.hashCode$0 = EvaluatedValue.prototype.hashCode; |
| 13046 // ********** Code for NullValue ************** | 13011 // ********** Code for NullValue ************** |
| 13047 $inherits(NullValue, EvaluatedValue); | 13012 $inherits(NullValue, EvaluatedValue); |
| 13048 function NullValue(isConst, span) { | 13013 function NullValue(isConst, span) { |
| 13049 EvaluatedValue.call(this, isConst, $globals.world.varType, span); | 13014 EvaluatedValue.call(this, isConst, $globals.world.varType, span); |
| 13050 } | 13015 } |
| 13051 NullValue.prototype.get$actualValue = function() { | 13016 NullValue.prototype.get$actualValue = function() { |
| 13052 return null; | 13017 return null; |
| 13053 } | 13018 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13180 case (39): | 13145 case (39): |
| 13181 | 13146 |
| 13182 return new IntValue(x << y, c, s); | 13147 return new IntValue(x << y, c, s); |
| 13183 | 13148 |
| 13184 case (40): | 13149 case (40): |
| 13185 | 13150 |
| 13186 return new IntValue(x >> y, c, s); | 13151 return new IntValue(x >> y, c, s); |
| 13187 | 13152 |
| 13188 case (42): | 13153 case (42): |
| 13189 | 13154 |
| 13190 return new IntValue($add(x, y), c, s); | 13155 return new IntValue(x + y, c, s); |
| 13191 | 13156 |
| 13192 case (43): | 13157 case (43): |
| 13193 | 13158 |
| 13194 return new IntValue(x - y, c, s); | 13159 return new IntValue(x - y, c, s); |
| 13195 | 13160 |
| 13196 case (44): | 13161 case (44): |
| 13197 | 13162 |
| 13198 return new IntValue(x * y, c, s); | 13163 return new IntValue(x * y, c, s); |
| 13199 | 13164 |
| 13200 case (45): | 13165 case (45): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13236 | 13201 |
| 13237 return new BoolValue(x == y, c, s); | 13202 return new BoolValue(x == y, c, s); |
| 13238 | 13203 |
| 13239 case (51): | 13204 case (51): |
| 13240 case (49): | 13205 case (49): |
| 13241 | 13206 |
| 13242 return new BoolValue(x != y, c, s); | 13207 return new BoolValue(x != y, c, s); |
| 13243 | 13208 |
| 13244 case (42): | 13209 case (42): |
| 13245 | 13210 |
| 13246 return new DoubleValue($add(x, y), c, s); | 13211 return new DoubleValue(x + y, c, s); |
| 13247 | 13212 |
| 13248 case (43): | 13213 case (43): |
| 13249 | 13214 |
| 13250 return new DoubleValue(x - y, c, s); | 13215 return new DoubleValue(x - y, c, s); |
| 13251 | 13216 |
| 13252 case (44): | 13217 case (44): |
| 13253 | 13218 |
| 13254 return new DoubleValue(x * y, c, s); | 13219 return new DoubleValue(x * y, c, s); |
| 13255 | 13220 |
| 13256 case (45): | 13221 case (45): |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13322 | 13287 |
| 13323 return new BoolValue(x == y, c, s); | 13288 return new BoolValue(x == y, c, s); |
| 13324 | 13289 |
| 13325 case (51): | 13290 case (51): |
| 13326 case (49): | 13291 case (49): |
| 13327 | 13292 |
| 13328 return new BoolValue(x != y, c, s); | 13293 return new BoolValue(x != y, c, s); |
| 13329 | 13294 |
| 13330 case (42): | 13295 case (42): |
| 13331 | 13296 |
| 13332 return new DoubleValue($add(x, y), c, s); | 13297 return new DoubleValue(x + y, c, s); |
| 13333 | 13298 |
| 13334 case (43): | 13299 case (43): |
| 13335 | 13300 |
| 13336 return new DoubleValue(x - y, c, s); | 13301 return new DoubleValue(x - y, c, s); |
| 13337 | 13302 |
| 13338 case (44): | 13303 case (44): |
| 13339 | 13304 |
| 13340 return new DoubleValue(x * y, c, s); | 13305 return new DoubleValue(x * y, c, s); |
| 13341 | 13306 |
| 13342 case (45): | 13307 case (45): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13378 | 13343 |
| 13379 return new BoolValue(x == y, c, s); | 13344 return new BoolValue(x == y, c, s); |
| 13380 | 13345 |
| 13381 case (51): | 13346 case (51): |
| 13382 case (49): | 13347 case (49): |
| 13383 | 13348 |
| 13384 return new BoolValue(x != y, c, s); | 13349 return new BoolValue(x != y, c, s); |
| 13385 | 13350 |
| 13386 case (42): | 13351 case (42): |
| 13387 | 13352 |
| 13388 return new DoubleValue($add(x, y), c, s); | 13353 return new DoubleValue(x + y, c, s); |
| 13389 | 13354 |
| 13390 case (43): | 13355 case (43): |
| 13391 | 13356 |
| 13392 return new DoubleValue(x - y, c, s); | 13357 return new DoubleValue(x - y, c, s); |
| 13393 | 13358 |
| 13394 case (44): | 13359 case (44): |
| 13395 | 13360 |
| 13396 return new DoubleValue(x * y, c, s); | 13361 return new DoubleValue(x * y, c, s); |
| 13397 | 13362 |
| 13398 case (45): | 13363 case (45): |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13543 function ListValue(values, isConst, type, span) { | 13508 function ListValue(values, isConst, type, span) { |
| 13544 this.values = values; | 13509 this.values = values; |
| 13545 EvaluatedValue.call(this, isConst, type, span); | 13510 EvaluatedValue.call(this, isConst, type, span); |
| 13546 } | 13511 } |
| 13547 ListValue.prototype.get$code = function() { | 13512 ListValue.prototype.get$code = function() { |
| 13548 var buf = new StringBufferImpl(""); | 13513 var buf = new StringBufferImpl(""); |
| 13549 buf.add$1("["); | 13514 buf.add$1("["); |
| 13550 for (var i = (0); | 13515 for (var i = (0); |
| 13551 i < this.values.get$length(); i = $add(i, (1))) { | 13516 i < this.values.get$length(); i = $add(i, (1))) { |
| 13552 if (i > (0)) buf.add$1(", "); | 13517 if (i > (0)) buf.add$1(", "); |
| 13553 buf.add$1(this.values[i].get$code()); | 13518 buf.add$1(this.values.$index(i).get$code()); |
| 13554 } | 13519 } |
| 13555 buf.add$1("]"); | 13520 buf.add$1("]"); |
| 13556 var listCode = buf.toString$0(); | 13521 var listCode = buf.toString$0(); |
| 13557 if (!this.isConst) return listCode; | 13522 if (!this.isConst) return listCode; |
| 13558 var v = new Value($globals.world.listType, listCode, this.span); | 13523 var v = new Value($globals.world.listType, listCode, this.span); |
| 13559 var immutableListCtor = $globals.world.immutableListType.getConstructor("from"
); | 13524 var immutableListCtor = $globals.world.immutableListType.getConstructor("from"
); |
| 13560 var result = immutableListCtor.invoke$4(null, null, new TypeValue(v.get$type()
, this.span), new Arguments(null, [v])); | 13525 var result = immutableListCtor.invoke$4(null, null, new TypeValue(v.get$type()
, this.span), new Arguments(null, [v])); |
| 13561 return result.get$code(); | 13526 return result.get$code(); |
| 13562 } | 13527 } |
| 13563 ListValue.prototype.binop = function(kind, other, context, node) { | 13528 ListValue.prototype.binop = function(kind, other, context, node) { |
| 13564 if (!(other instanceof ListValue)) return Value.prototype.binop.call(this, kin
d, other, context, node); | 13529 if (!(other instanceof ListValue)) return Value.prototype.binop.call(this, kin
d, other, context, node); |
| 13565 switch (kind) { | 13530 switch (kind) { |
| 13566 case (50): | 13531 case (50): |
| 13567 | 13532 |
| 13568 return new BoolValue($eq(this.get$type(), other.get$type()) && this.get$co
de() == other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13533 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() =
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13569 | 13534 |
| 13570 case (51): | 13535 case (51): |
| 13571 | 13536 |
| 13572 return new BoolValue($ne(this.get$type(), other.get$type()) || this.get$co
de() != other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13537 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() !
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13573 | 13538 |
| 13574 } | 13539 } |
| 13575 return Value.prototype.binop.call(this, kind, other, context, node); | 13540 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13576 } | 13541 } |
| 13577 ListValue.prototype.getGlobalValue = function() { | 13542 ListValue.prototype.getGlobalValue = function() { |
| 13578 return $globals.world.gen.globalForConst(this, this.values); | 13543 return $globals.world.gen.globalForConst(this, this.values); |
| 13579 } | 13544 } |
| 13580 ListValue.prototype.binop$4 = ListValue.prototype.binop; | 13545 ListValue.prototype.binop$4 = ListValue.prototype.binop; |
| 13581 ListValue.prototype.getGlobalValue$0 = ListValue.prototype.getGlobalValue; | 13546 ListValue.prototype.getGlobalValue$0 = ListValue.prototype.getGlobalValue; |
| 13582 // ********** Code for MapValue ************** | 13547 // ********** Code for MapValue ************** |
| (...skipping 10 matching lines...) Expand all Loading... |
| 13593 return value.get$code(); | 13558 return value.get$code(); |
| 13594 } | 13559 } |
| 13595 MapValue.prototype.getGlobalValue = function() { | 13560 MapValue.prototype.getGlobalValue = function() { |
| 13596 return $globals.world.gen.globalForConst(this, this.values); | 13561 return $globals.world.gen.globalForConst(this, this.values); |
| 13597 } | 13562 } |
| 13598 MapValue.prototype.binop = function(kind, other, context, node) { | 13563 MapValue.prototype.binop = function(kind, other, context, node) { |
| 13599 if (!(other instanceof MapValue)) return Value.prototype.binop.call(this, kind
, other, context, node); | 13564 if (!(other instanceof MapValue)) return Value.prototype.binop.call(this, kind
, other, context, node); |
| 13600 switch (kind) { | 13565 switch (kind) { |
| 13601 case (50): | 13566 case (50): |
| 13602 | 13567 |
| 13603 return new BoolValue($eq(this.get$type(), other.get$type()) && this.get$co
de() == other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13568 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() =
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13604 | 13569 |
| 13605 case (51): | 13570 case (51): |
| 13606 | 13571 |
| 13607 return new BoolValue($ne(this.get$type(), other.get$type()) || this.get$co
de() != other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13572 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() !
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13608 | 13573 |
| 13609 } | 13574 } |
| 13610 return Value.prototype.binop.call(this, kind, other, context, node); | 13575 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13611 } | 13576 } |
| 13612 MapValue.prototype.binop$4 = MapValue.prototype.binop; | 13577 MapValue.prototype.binop$4 = MapValue.prototype.binop; |
| 13613 MapValue.prototype.getGlobalValue$0 = MapValue.prototype.getGlobalValue; | 13578 MapValue.prototype.getGlobalValue$0 = MapValue.prototype.getGlobalValue; |
| 13614 // ********** Code for ObjectValue ************** | 13579 // ********** Code for ObjectValue ************** |
| 13615 $inherits(ObjectValue, EvaluatedValue); | 13580 $inherits(ObjectValue, EvaluatedValue); |
| 13616 function ObjectValue(isConst, type, span) { | 13581 function ObjectValue(isConst, type, span) { |
| 13617 this.seenNativeInitializer = false; | 13582 this.seenNativeInitializer = false; |
| 13618 this.fields = new HashMapImplementation(); | 13583 this.fields = new HashMapImplementation(); |
| 13619 EvaluatedValue.call(this, isConst, type, span); | 13584 EvaluatedValue.call(this, isConst, type, span); |
| 13620 } | 13585 } |
| 13621 ObjectValue.prototype.get$fields = function() { return this.fields; }; | 13586 ObjectValue.prototype.get$fields = function() { return this.fields; }; |
| 13622 ObjectValue.prototype.get$seenNativeInitializer = function() { return this.seenN
ativeInitializer; }; | 13587 ObjectValue.prototype.get$seenNativeInitializer = function() { return this.seenN
ativeInitializer; }; |
| 13623 ObjectValue.prototype.set$seenNativeInitializer = function(value) { return this.
seenNativeInitializer = value; }; | 13588 ObjectValue.prototype.set$seenNativeInitializer = function(value) { return this.
seenNativeInitializer = value; }; |
| 13624 ObjectValue.prototype.get$code = function() { | 13589 ObjectValue.prototype.get$code = function() { |
| 13625 if (this._code == null) this.validateInitialized(null); | 13590 if (this._code == null) this.validateInitialized(null); |
| 13626 return this._code; | 13591 return this._code; |
| 13627 } | 13592 } |
| 13628 ObjectValue.prototype.initFields = function() { | 13593 ObjectValue.prototype.initFields = function() { |
| 13629 var allMembers = $globals.world.gen._orderValues(this.get$type().getAllMembers
()); | 13594 var allMembers = $globals.world.gen._orderValues(this.type.getAllMembers()); |
| 13630 for (var $$i = allMembers.iterator$0(); $$i.hasNext$0(); ) { | 13595 for (var $$i = allMembers.iterator$0(); $$i.hasNext$0(); ) { |
| 13631 var f = $$i.next$0(); | 13596 var f = $$i.next$0(); |
| 13632 if (f.get$isField() && !f.get$isStatic() && f.get$declaringType().get$isClas
s()) { | 13597 if (f.get$isField() && !f.get$isStatic() && f.get$declaringType().get$isClas
s()) { |
| 13633 this.fields.$setindex(f, f.computeValue$0()); | 13598 this.fields.$setindex(f, f.computeValue$0()); |
| 13634 } | 13599 } |
| 13635 } | 13600 } |
| 13636 } | 13601 } |
| 13637 ObjectValue.prototype.setField = function(field, value, duringInit) { | 13602 ObjectValue.prototype.setField = function(field, value, duringInit) { |
| 13638 if (value.get$isConst() && (value instanceof VariableValue)) { | 13603 if (value.get$isConst() && (value instanceof VariableValue)) { |
| 13639 value = value.get$dynamic().get$value(); | 13604 value = value.get$dynamic().get$value(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 13653 $globals.world.error("reassignment of field not allowed", value.span, fiel
d.get$span()); | 13618 $globals.world.error("reassignment of field not allowed", value.span, fiel
d.get$span()); |
| 13654 } | 13619 } |
| 13655 else { | 13620 else { |
| 13656 this.fields.$setindex(field, value); | 13621 this.fields.$setindex(field, value); |
| 13657 } | 13622 } |
| 13658 } | 13623 } |
| 13659 } | 13624 } |
| 13660 ObjectValue.prototype.validateInitialized = function(span) { | 13625 ObjectValue.prototype.validateInitialized = function(span) { |
| 13661 var buf = new StringBufferImpl(""); | 13626 var buf = new StringBufferImpl(""); |
| 13662 buf.add$1("Object.create("); | 13627 buf.add$1("Object.create("); |
| 13663 buf.add$1(("" + this.get$type().get$jsname() + ".prototype, ")); | 13628 buf.add$1(("" + this.type.get$jsname() + ".prototype, ")); |
| 13664 buf.add$1("{"); | 13629 buf.add$1("{"); |
| 13665 var $$list = this.fields.getKeys(); | 13630 var $$list = this.fields.getKeys$0(); |
| 13666 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 13631 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 13667 var field = $$i.next$0(); | 13632 var field = $$i.next$0(); |
| 13668 buf.add$1(field.get$name()); | 13633 buf.add$1(field.get$name()); |
| 13669 buf.add$1(": "); | 13634 buf.add$1(": "); |
| 13670 buf.add$1("{\"value\": "); | 13635 buf.add$1("{\"value\": "); |
| 13671 if (this.fields.$index(field) == null) { | 13636 if (this.fields.$index(field) == null) { |
| 13672 $globals.world.error(("Required field \"" + field.get$name() + "\" was not
initialized"), span, field.get$span()); | 13637 $globals.world.error(("Required field \"" + field.get$name() + "\" was not
initialized"), span, field.get$span()); |
| 13673 buf.add$1("null"); | 13638 buf.add$1("null"); |
| 13674 } | 13639 } |
| 13675 else { | 13640 else { |
| 13676 buf.add$1(this.fields.$index(field).get$code()); | 13641 buf.add$1(this.fields.$index(field).get$code()); |
| 13677 } | 13642 } |
| 13678 buf.add$1(", writeable: false}, "); | 13643 buf.add$1(", writeable: false}, "); |
| 13679 } | 13644 } |
| 13680 buf.add$1("})"); | 13645 buf.add$1("})"); |
| 13681 this._code = buf.toString$0(); | 13646 this._code = buf.toString$0(); |
| 13682 } | 13647 } |
| 13683 ObjectValue.prototype.binop = function(kind, other, context, node) { | 13648 ObjectValue.prototype.binop = function(kind, other, context, node) { |
| 13684 if (!(other instanceof ObjectValue)) return Value.prototype.binop.call(this, k
ind, other, context, node); | 13649 if (!(other instanceof ObjectValue)) return Value.prototype.binop.call(this, k
ind, other, context, node); |
| 13685 switch (kind) { | 13650 switch (kind) { |
| 13686 case (50): | 13651 case (50): |
| 13687 case (48): | 13652 case (48): |
| 13688 | 13653 |
| 13689 return new BoolValue($eq(this.get$type(), other.get$type()) && this.get$co
de() == other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13654 return new BoolValue($eq(this.type, other.get$type()) && this.get$code() =
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13690 | 13655 |
| 13691 case (51): | 13656 case (51): |
| 13692 case (49): | 13657 case (49): |
| 13693 | 13658 |
| 13694 return new BoolValue($ne(this.get$type(), other.get$type()) || this.get$co
de() != other.get$code(), this.isConst && other.get$isConst(), node.get$span()); | 13659 return new BoolValue($ne(this.type, other.get$type()) || this.get$code() !
= other.get$code(), this.isConst && other.get$isConst(), node.get$span()); |
| 13695 | 13660 |
| 13696 } | 13661 } |
| 13697 return Value.prototype.binop.call(this, kind, other, context, node); | 13662 return Value.prototype.binop.call(this, kind, other, context, node); |
| 13698 } | 13663 } |
| 13699 ObjectValue.prototype.binop$4 = ObjectValue.prototype.binop; | 13664 ObjectValue.prototype.binop$4 = ObjectValue.prototype.binop; |
| 13700 ObjectValue.prototype.initFields$0 = ObjectValue.prototype.initFields; | 13665 ObjectValue.prototype.initFields$0 = ObjectValue.prototype.initFields; |
| 13701 // ********** Code for GlobalValue ************** | 13666 // ********** Code for GlobalValue ************** |
| 13702 $inherits(GlobalValue, Value); | 13667 $inherits(GlobalValue, Value); |
| 13703 function GlobalValue(type, code, isConst, field, name, exp, span, deps) { | 13668 function GlobalValue(type, code, isConst, field, name, exp, span, deps) { |
| 13704 this.exp = exp; | 13669 this.exp = exp; |
| 13705 this.field = field; | 13670 this.field = field; |
| 13706 this.name = name; | 13671 this.name = name; |
| 13707 this.dependencies = []; | 13672 this.dependencies = []; |
| 13708 this.isConst = isConst; | 13673 this.isConst = isConst; |
| 13709 Value.call(this, type, code, span); | 13674 Value.call(this, type, code, span); |
| 13710 for (var $$i = 0;$$i < deps.get$length(); $$i++) { | 13675 for (var $$i = 0;$$i < deps.get$length(); $$i++) { |
| 13711 var dep = deps[$$i]; | 13676 var dep = deps.$index($$i); |
| 13712 if ((dep instanceof GlobalValue)) { | 13677 if ((dep instanceof GlobalValue)) { |
| 13713 this.dependencies.add(dep); | 13678 this.dependencies.add(dep); |
| 13714 this.dependencies.addAll(dep.get$dependencies()); | 13679 this.dependencies.addAll(dep.get$dependencies()); |
| 13715 } | 13680 } |
| 13716 } | 13681 } |
| 13717 } | 13682 } |
| 13718 GlobalValue.prototype.get$field = function() { return this.field; }; | 13683 GlobalValue.prototype.get$field = function() { return this.field; }; |
| 13719 GlobalValue.prototype.get$name = function() { return this.name; }; | 13684 GlobalValue.prototype.get$name = function() { return this.name; }; |
| 13720 GlobalValue.prototype.get$exp = function() { return this.exp; }; | 13685 GlobalValue.prototype.get$exp = function() { return this.exp; }; |
| 13721 GlobalValue.prototype.get$isConst = function() { return this.isConst; }; | 13686 GlobalValue.prototype.get$isConst = function() { return this.isConst; }; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13767 BareValue.prototype.get$needsTemp = function() { | 13732 BareValue.prototype.get$needsTemp = function() { |
| 13768 return false; | 13733 return false; |
| 13769 } | 13734 } |
| 13770 BareValue.prototype._shouldBindDynamically = function() { | 13735 BareValue.prototype._shouldBindDynamically = function() { |
| 13771 return false; | 13736 return false; |
| 13772 } | 13737 } |
| 13773 BareValue.prototype.get$code = function() { | 13738 BareValue.prototype.get$code = function() { |
| 13774 return this._code; | 13739 return this._code; |
| 13775 } | 13740 } |
| 13776 BareValue.prototype._ensureCode = function() { | 13741 BareValue.prototype._ensureCode = function() { |
| 13777 if (this._code == null) this._code = this.isType ? this.get$type().get$jsname(
) : this.home._makeThisCode(); | 13742 if (this._code == null) this._code = this.isType ? this.type.get$jsname() : th
is.home._makeThisCode(); |
| 13778 } | 13743 } |
| 13779 BareValue.prototype._tryResolveMember = function(context, name, isDynamic, node)
{ | 13744 BareValue.prototype._tryResolveMember = function(context, resolveType, name) { |
| 13780 var member = this.get$type().getMember(name); | 13745 var member = resolveType.resolveMember(name); |
| 13781 if (member == null || $ne(member.get$declaringType(), this.get$type())) { | 13746 if (member != null) { |
| 13782 var libMember = this.home.get$library().lookup(name, this.span); | 13747 if ($globals.options.forceDynamic && !member.get$isStatic()) { |
| 13783 if (libMember != null) { | 13748 member = context.findMembers(name); |
| 13784 return libMember.get$preciseMemberSet(); | |
| 13785 } | 13749 } |
| 13750 this._ensureCode(); |
| 13751 return member; |
| 13752 } |
| 13753 member = this.home.get$library().lookup(name, this.span); |
| 13754 if (member != null) { |
| 13755 return member; |
| 13786 } | 13756 } |
| 13787 this._ensureCode(); | 13757 this._ensureCode(); |
| 13788 return Value.prototype._tryResolveMember.call(this, context, name, isDynamic,
node); | 13758 return null; |
| 13789 } | 13759 } |
| 13790 // ********** Code for SuperValue ************** | 13760 // ********** Code for SuperValue ************** |
| 13791 $inherits(SuperValue, Value); | 13761 $inherits(SuperValue, Value); |
| 13792 function SuperValue(parentType, span) { | 13762 function SuperValue(parentType, span) { |
| 13793 Value.call(this, parentType, "this", span); | 13763 Value.call(this, parentType, "this", span); |
| 13794 } | 13764 } |
| 13795 SuperValue.prototype.get$needsTemp = function() { | 13765 SuperValue.prototype.get$needsTemp = function() { |
| 13796 return false; | 13766 return false; |
| 13797 } | 13767 } |
| 13798 SuperValue.prototype.get$isSuper = function() { | 13768 SuperValue.prototype.get$isSuper = function() { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13884 VariableValue.prototype.get$type = function() { | 13854 VariableValue.prototype.get$type = function() { |
| 13885 return this.value != null ? this.value.get$type() : this.get$staticType(); | 13855 return this.value != null ? this.value.get$type() : this.get$staticType(); |
| 13886 } | 13856 } |
| 13887 VariableValue.prototype.get$staticType = function() { | 13857 VariableValue.prototype.get$staticType = function() { |
| 13888 return this.type; | 13858 return this.type; |
| 13889 } | 13859 } |
| 13890 VariableValue.prototype.get$isConst = function() { | 13860 VariableValue.prototype.get$isConst = function() { |
| 13891 return this.value != null ? this.value.get$isConst() : false; | 13861 return this.value != null ? this.value.get$isConst() : false; |
| 13892 } | 13862 } |
| 13893 VariableValue.prototype.replaceValue = function(v) { | 13863 VariableValue.prototype.replaceValue = function(v) { |
| 13894 return new VariableValue(this.get$staticType(), this.get$code(), this.span, th
is.isFinal, v); | 13864 return new VariableValue(this.get$staticType(), this.code, this.span, this.isF
inal, v); |
| 13895 } | 13865 } |
| 13896 VariableValue.prototype.unop = function(kind, context, node) { | 13866 VariableValue.prototype.unop = function(kind, context, node) { |
| 13897 if (this.value != null) { | 13867 if (this.value != null) { |
| 13898 return this.replaceValue(this.value.unop(kind, context, node)); | 13868 return this.replaceValue(this.value.unop(kind, context, node)); |
| 13899 } | 13869 } |
| 13900 return Value.prototype.unop.call(this, kind, context, node); | 13870 return Value.prototype.unop.call(this, kind, context, node); |
| 13901 } | 13871 } |
| 13902 VariableValue.prototype.binop = function(kind, other, context, node) { | 13872 VariableValue.prototype.binop = function(kind, other, context, node) { |
| 13903 if (this.value != null) { | 13873 if (this.value != null) { |
| 13904 return this.replaceValue(this.value.binop(kind, VariableValue._unwrap(other)
, context, node)); | 13874 return this.replaceValue(this.value.binop(kind, VariableValue._unwrap(other)
, context, node)); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 13917 if (this._location != null) { | 13887 if (this._location != null) { |
| 13918 return ("CompilerException: " + this._location.toMessageString(this._lang_me
ssage)); | 13888 return ("CompilerException: " + this._location.toMessageString(this._lang_me
ssage)); |
| 13919 } | 13889 } |
| 13920 else { | 13890 else { |
| 13921 return ("CompilerException: " + this._lang_message); | 13891 return ("CompilerException: " + this._lang_message); |
| 13922 } | 13892 } |
| 13923 } | 13893 } |
| 13924 CompilerException.prototype.toString$0 = CompilerException.prototype.toString; | 13894 CompilerException.prototype.toString$0 = CompilerException.prototype.toString; |
| 13925 // ********** Code for CounterLog ************** | 13895 // ********** Code for CounterLog ************** |
| 13926 function CounterLog() { | 13896 function CounterLog() { |
| 13927 this.msetN = (0); | |
| 13928 this.objectProtoMembers = (0); | 13897 this.objectProtoMembers = (0); |
| 13929 this.dynamicMethodCalls = (0); | 13898 this.dynamicMethodCalls = (0); |
| 13930 this.typeAsserts = (0); | 13899 this.typeAsserts = (0); |
| 13931 this.invokeCalls = (0); | |
| 13932 } | 13900 } |
| 13933 CounterLog.prototype.info = function() { | 13901 CounterLog.prototype.info = function() { |
| 13934 $globals.world.info(("Dynamically typed method calls: " + this.dynamicMethodCa
lls)); | 13902 $globals.world.info(("Dynamically typed method calls: " + this.dynamicMethodCa
lls)); |
| 13935 $globals.world.info(("Generated type assertions: " + this.typeAsserts)); | 13903 $globals.world.info(("Generated type assertions: " + this.typeAsserts)); |
| 13936 $globals.world.info(("Members on Object.prototype: " + this.objectProtoMembers
)); | 13904 $globals.world.info(("Members on Object.prototype: " + this.objectProtoMembers
)); |
| 13937 $globals.world.info(("Invoke calls: " + this.invokeCalls)); | |
| 13938 $globals.world.info(("msetN calls: " + this.msetN)); | |
| 13939 } | 13905 } |
| 13940 CounterLog.prototype.add = function(other) { | 13906 CounterLog.prototype.add = function(other) { |
| 13941 this.dynamicMethodCalls = $add(this.dynamicMethodCalls, other.dynamicMethodCal
ls); | 13907 this.dynamicMethodCalls += other.dynamicMethodCalls; |
| 13942 this.typeAsserts = $add(this.typeAsserts, other.typeAsserts); | 13908 this.typeAsserts += other.typeAsserts; |
| 13943 this.objectProtoMembers = $add(this.objectProtoMembers, other.objectProtoMembe
rs); | 13909 this.objectProtoMembers += other.objectProtoMembers; |
| 13944 this.invokeCalls = $add(this.invokeCalls, other.invokeCalls); | |
| 13945 this.msetN = $add(this.msetN, other.msetN); | |
| 13946 } | 13910 } |
| 13947 CounterLog.prototype.add$1 = CounterLog.prototype.add; | 13911 CounterLog.prototype.add$1 = CounterLog.prototype.add; |
| 13948 // ********** Code for World ************** | 13912 // ********** Code for World ************** |
| 13949 function World(files) { | 13913 function World(files) { |
| 13950 this.files = files; | 13914 this.files = files; |
| 13951 this._members = new HashMapImplementation(); | 13915 this._members = new HashMapImplementation(); |
| 13952 this._topNames = new HashMapImplementation(); | 13916 this._topNames = new HashMapImplementation(); |
| 13953 this.warnings = (0); | 13917 this.warnings = (0); |
| 13954 this.seenFatal = false; | 13918 this.seenFatal = false; |
| 13955 this.libraries = new HashMapImplementation(); | 13919 this.libraries = new HashMapImplementation(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14098 this.printStatus(); | 14062 this.printStatus(); |
| 14099 return !this.get$hasErrors(); | 14063 return !this.get$hasErrors(); |
| 14100 } | 14064 } |
| 14101 World.prototype.runLeg = function() { | 14065 World.prototype.runLeg = function() { |
| 14102 var $this = this; // closure support | 14066 var $this = this; // closure support |
| 14103 if (!$globals.options.enableLeg) return false; | 14067 if (!$globals.options.enableLeg) return false; |
| 14104 if ($globals.legCompile == null) { | 14068 if ($globals.legCompile == null) { |
| 14105 this.fatal("requested leg enabled, but no leg compiler available"); | 14069 this.fatal("requested leg enabled, but no leg compiler available"); |
| 14106 } | 14070 } |
| 14107 var res = this.withTiming("try leg compile", (function () { | 14071 var res = this.withTiming("try leg compile", (function () { |
| 14108 return $globals.legCompile.call$1($this); | 14072 return $globals.legCompile($this); |
| 14109 }) | 14073 }) |
| 14110 ); | 14074 ); |
| 14111 if (!res && $globals.options.legOnly) { | 14075 if (!res && $globals.options.legOnly) { |
| 14112 this.fatal(("Leg could not compile " + $globals.options.dartScript)); | 14076 this.fatal(("Leg could not compile " + $globals.options.dartScript)); |
| 14113 return true; | 14077 return true; |
| 14114 } | 14078 } |
| 14115 return res; | 14079 return res; |
| 14116 } | 14080 } |
| 14117 World.prototype.runCompilationPhases = function() { | 14081 World.prototype.runCompilationPhases = function() { |
| 14118 var $this = this; // closure support | 14082 var $this = this; // closure support |
| (...skipping 14 matching lines...) Expand all Loading... |
| 14133 if (this.legCode != null) { | 14097 if (this.legCode != null) { |
| 14134 return this.legCode; | 14098 return this.legCode; |
| 14135 } | 14099 } |
| 14136 else { | 14100 else { |
| 14137 return this.frogCode; | 14101 return this.frogCode; |
| 14138 } | 14102 } |
| 14139 } | 14103 } |
| 14140 World.prototype.readFile = function(filename) { | 14104 World.prototype.readFile = function(filename) { |
| 14141 try { | 14105 try { |
| 14142 var sourceFile = this.reader.readFile(filename); | 14106 var sourceFile = this.reader.readFile(filename); |
| 14143 this.dartBytesRead = $add(this.dartBytesRead, sourceFile.get$text().get$leng
th()); | 14107 this.dartBytesRead = this.dartBytesRead + sourceFile.get$text().get$length()
; |
| 14144 return sourceFile; | 14108 return sourceFile; |
| 14145 } catch (e) { | 14109 } catch (e) { |
| 14146 e = _toDartException(e); | 14110 e = _toDartException(e); |
| 14147 this.warning(("Error reading file: " + filename)); | 14111 this.warning(("Error reading file: " + filename)); |
| 14148 return new SourceFile(filename, ""); | 14112 return new SourceFile(filename, ""); |
| 14149 } | 14113 } |
| 14150 } | 14114 } |
| 14151 World.prototype.getOrAddLibrary = function(filename) { | 14115 World.prototype.getOrAddLibrary = function(filename) { |
| 14152 var library = this.libraries.$index(filename); | 14116 var library = this.libraries.$index(filename); |
| 14153 if (library == null) { | 14117 if (library == null) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 14177 } | 14141 } |
| 14178 } | 14142 } |
| 14179 } | 14143 } |
| 14180 World.prototype.processDartScript = function(script) { | 14144 World.prototype.processDartScript = function(script) { |
| 14181 if (script == null) script = $globals.options.dartScript; | 14145 if (script == null) script = $globals.options.dartScript; |
| 14182 var library = this.getOrAddLibrary(script); | 14146 var library = this.getOrAddLibrary(script); |
| 14183 this.process(); | 14147 this.process(); |
| 14184 return library; | 14148 return library; |
| 14185 } | 14149 } |
| 14186 World.prototype.resolveAll = function() { | 14150 World.prototype.resolveAll = function() { |
| 14187 var $$list = this.libraries.getValues(); | 14151 var $$list = this.libraries.getValues$0(); |
| 14188 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 14152 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 14189 var lib = $$i.next$0(); | 14153 var lib = $$i.next$0(); |
| 14190 lib.resolve$0(); | 14154 lib.resolve$0(); |
| 14191 } | 14155 } |
| 14192 var $$list = this.libraries.getValues(); | 14156 var $$list = this.libraries.getValues$0(); |
| 14193 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { | 14157 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 14194 var lib = $$i.next$0(); | 14158 var lib = $$i.next$0(); |
| 14195 lib.postResolveChecks$0(); | 14159 lib.postResolveChecks$0(); |
| 14196 } | 14160 } |
| 14197 } | 14161 } |
| 14198 World.prototype.get$resolveAll = function() { | 14162 World.prototype.get$resolveAll = function() { |
| 14199 return this.resolveAll.bind(this); | 14163 return this.resolveAll.bind(this); |
| 14200 } | 14164 } |
| 14201 World.prototype.findMainMethod = function(lib) { | 14165 World.prototype.findMainMethod = function(lib) { |
| 14202 var main = lib.lookup("main", lib.get$span()); | 14166 var mainMembers = lib.topType.resolveMember("main"); |
| 14203 if (main == null) { | 14167 var main = null; |
| 14168 if (mainMembers == null || $eq(mainMembers.get$members().get$length(), (0))) { |
| 14204 this.fatal("no main method specified"); | 14169 this.fatal("no main method specified"); |
| 14205 } | 14170 } |
| 14171 else if (mainMembers.get$members().get$length() > (1)) { |
| 14172 var $$list = mainMembers.get$members(); |
| 14173 for (var $$i = $$list.iterator$0(); $$i.hasNext$0(); ) { |
| 14174 var m = $$i.next$0(); |
| 14175 main = m; |
| 14176 this.error("more than one main member (using last?)", main.get$span()); |
| 14177 } |
| 14178 } |
| 14179 else { |
| 14180 main = mainMembers.get$members().$index((0)); |
| 14181 } |
| 14206 return main; | 14182 return main; |
| 14207 } | 14183 } |
| 14208 World.prototype.generateCode = function(lib) { | 14184 World.prototype.generateCode = function(lib) { |
| 14209 this.gen = new WorldGenerator(this.findMainMethod(lib), new CodeWriter()); | 14185 this.gen = new WorldGenerator(this.findMainMethod(lib), new CodeWriter()); |
| 14210 this.gen.run(); | 14186 this.gen.run(); |
| 14211 this.frogCode = this.gen.writer.get$text(); | 14187 this.frogCode = this.gen.writer.get$text(); |
| 14212 this.jsBytesWritten = this.frogCode.length; | 14188 this.jsBytesWritten = this.frogCode.length; |
| 14213 this.gen = null; | 14189 this.gen = null; |
| 14214 } | 14190 } |
| 14215 World.prototype._message = function(color, prefix, message, span, span1, span2,
throwing) { | 14191 World.prototype._message = function(color, prefix, message, span, span1, span2,
throwing) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14264 } | 14240 } |
| 14265 World.prototype.info = function(message, span, span1, span2) { | 14241 World.prototype.info = function(message, span, span1, span2) { |
| 14266 if ($globals.options.showInfo) { | 14242 if ($globals.options.showInfo) { |
| 14267 this._message($globals._GREEN_COLOR, "info: ", message, span, span1, span2,
false); | 14243 this._message($globals._GREEN_COLOR, "info: ", message, span, span1, span2,
false); |
| 14268 } | 14244 } |
| 14269 } | 14245 } |
| 14270 World.prototype.withoutForceDynamic = function(fn) { | 14246 World.prototype.withoutForceDynamic = function(fn) { |
| 14271 var oldForceDynamic = $globals.options.forceDynamic; | 14247 var oldForceDynamic = $globals.options.forceDynamic; |
| 14272 $globals.options.forceDynamic = false; | 14248 $globals.options.forceDynamic = false; |
| 14273 try { | 14249 try { |
| 14274 return fn.call$0(); | 14250 return fn(); |
| 14275 } finally { | 14251 } finally { |
| 14276 $globals.options.forceDynamic = oldForceDynamic; | 14252 $globals.options.forceDynamic = oldForceDynamic; |
| 14277 } | 14253 } |
| 14278 } | 14254 } |
| 14279 World.prototype.get$hasErrors = function() { | 14255 World.prototype.get$hasErrors = function() { |
| 14280 return this.errors > (0); | 14256 return this.errors > (0); |
| 14281 } | 14257 } |
| 14282 World.prototype.printStatus = function() { | 14258 World.prototype.printStatus = function() { |
| 14283 this.counters.info(); | 14259 this.counters.info(); |
| 14284 this.info(("compiled " + this.dartBytesRead + " bytes Dart -> " + this.jsBytes
Written + " bytes JS")); | 14260 this.info(("compiled " + this.dartBytesRead + " bytes Dart -> " + this.jsBytes
Written + " bytes JS")); |
| 14285 if (this.get$hasErrors()) { | 14261 if (this.get$hasErrors()) { |
| 14286 print(("compilation failed with " + this.errors + " errors")); | 14262 print(("compilation failed with " + this.errors + " errors")); |
| 14287 } | 14263 } |
| 14288 else { | 14264 else { |
| 14289 if (this.warnings > (0)) { | 14265 if (this.warnings > (0)) { |
| 14290 this.info(("compilation completed successfully with " + this.warnings + "
warnings")); | 14266 this.info(("compilation completed successfully with " + this.warnings + "
warnings")); |
| 14291 } | 14267 } |
| 14292 else { | 14268 else { |
| 14293 this.info("compilation completed sucessfully"); | 14269 this.info("compilation completed sucessfully"); |
| 14294 } | 14270 } |
| 14295 } | 14271 } |
| 14296 } | 14272 } |
| 14297 World.prototype.withTiming = function(name, f) { | 14273 World.prototype.withTiming = function(name, f) { |
| 14298 var sw = new StopwatchImplementation(); | 14274 var sw = new StopwatchImplementation(); |
| 14299 sw.start$0(); | 14275 sw.start$0(); |
| 14300 var result = f.call$0(); | 14276 var result = f(); |
| 14301 sw.stop$0(); | 14277 sw.stop$0(); |
| 14302 this.info(("" + name + " in " + sw.elapsedInMs$0() + "msec")); | 14278 this.info(("" + name + " in " + sw.elapsedInMs$0() + "msec")); |
| 14303 return result; | 14279 return result; |
| 14304 } | 14280 } |
| 14305 // ********** Code for FrogOptions ************** | 14281 // ********** Code for FrogOptions ************** |
| 14306 function FrogOptions(homedir, args, files) { | 14282 function FrogOptions(homedir, args, files) { |
| 14307 this.legOnly = false; | 14283 this.legOnly = false; |
| 14308 this.throwOnFatal = false; | 14284 this.throwOnFatal = false; |
| 14309 this.maxInferenceIterations = (4); | 14285 this.maxInferenceIterations = (4); |
| 14310 this.config = "dev"; | 14286 this.config = "dev"; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 14332 else { | 14308 else { |
| 14333 $globals.world.error(("Invalid configuration " + this.config)); | 14309 $globals.world.error(("Invalid configuration " + this.config)); |
| 14334 $throw("Invalid configuration"); | 14310 $throw("Invalid configuration"); |
| 14335 } | 14311 } |
| 14336 var ignoreUnrecognizedFlags = false; | 14312 var ignoreUnrecognizedFlags = false; |
| 14337 var passedLibDir = false; | 14313 var passedLibDir = false; |
| 14338 this.childArgs = []; | 14314 this.childArgs = []; |
| 14339 loop: | 14315 loop: |
| 14340 for (var i = (2); | 14316 for (var i = (2); |
| 14341 i < args.get$length(); i++) { | 14317 i < args.get$length(); i++) { |
| 14342 var arg = args[i]; | 14318 var arg = args.$index(i); |
| 14343 switch (arg) { | 14319 switch (arg) { |
| 14344 case "--enable_leg": | 14320 case "--enable_leg": |
| 14345 | 14321 |
| 14346 this.enableLeg = true; | 14322 this.enableLeg = true; |
| 14347 break; | 14323 break; |
| 14348 | 14324 |
| 14349 case "--leg_only": | 14325 case "--leg_only": |
| 14350 | 14326 |
| 14351 this.enableLeg = true; | 14327 this.enableLeg = true; |
| 14352 this.legOnly = true; | 14328 this.legOnly = true; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14425 | 14401 |
| 14426 case "--Xinfer_types": | 14402 case "--Xinfer_types": |
| 14427 | 14403 |
| 14428 this.inferTypes = true; | 14404 this.inferTypes = true; |
| 14429 break; | 14405 break; |
| 14430 | 14406 |
| 14431 default: | 14407 default: |
| 14432 | 14408 |
| 14433 if (arg.endsWith$1(".dart")) { | 14409 if (arg.endsWith$1(".dart")) { |
| 14434 this.dartScript = arg; | 14410 this.dartScript = arg; |
| 14435 this.childArgs = args.getRange($add(i, (1)), args.get$length() - i - (
1)); | 14411 this.childArgs = args.getRange$2(i + (1), args.get$length() - i - (1))
; |
| 14436 break loop; | 14412 break loop; |
| 14437 } | 14413 } |
| 14438 else if (arg.startsWith$1("--out=")) { | 14414 else if (arg.startsWith$1("--out=")) { |
| 14439 this.outfile = arg.substring$1("--out=".length); | 14415 this.outfile = arg.substring$1("--out=".length); |
| 14440 } | 14416 } |
| 14441 else if (arg.startsWith$1("--libdir=")) { | 14417 else if (arg.startsWith$1("--libdir=")) { |
| 14442 this.libDir = arg.substring$1("--libdir=".length); | 14418 this.libDir = arg.substring$1("--libdir=".length); |
| 14443 passedLibDir = true; | 14419 passedLibDir = true; |
| 14444 } | 14420 } |
| 14445 else { | 14421 else { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14583 } | 14559 } |
| 14584 else { | 14560 else { |
| 14585 code.writeln(("" + this.body + ";")); | 14561 code.writeln(("" + this.body + ";")); |
| 14586 code.exitBlock(suffix); | 14562 code.exitBlock(suffix); |
| 14587 } | 14563 } |
| 14588 } | 14564 } |
| 14589 } | 14565 } |
| 14590 VarMethodStub.prototype._needsExactTypeCheck = function() { | 14566 VarMethodStub.prototype._needsExactTypeCheck = function() { |
| 14591 var $this = this; // closure support | 14567 var $this = this; // closure support |
| 14592 if (this.member == null || this.member.declaringType.get$isObject()) return fa
lse; | 14568 if (this.member == null || this.member.declaringType.get$isObject()) return fa
lse; |
| 14593 var members = this.member.get$potentialMemberSet().members; | 14569 var members = this.member.declaringType.resolveMember(this.member.name).member
s; |
| 14594 return members.filter$1((function (m) { | 14570 return members.filter$1((function (m) { |
| 14595 return $ne(m, $this.member) && m.get$declaringType().get$isHiddenNativeType(
); | 14571 return $ne(m, $this.member) && m.get$declaringType().get$isHiddenNativeType(
); |
| 14596 }) | 14572 }) |
| 14597 ).get$length() >= (1); | 14573 ).get$length() >= (1); |
| 14598 } | 14574 } |
| 14599 VarMethodStub.prototype._useDirectCall = function(args) { | 14575 VarMethodStub.prototype._useDirectCall = function(args) { |
| 14600 if ((this.member instanceof MethodMember) && !this.member.declaringType.get$ha
sNativeSubtypes()) { | 14576 if ((this.member instanceof MethodMember) && !this.member.declaringType.get$ha
sNativeSubtypes()) { |
| 14601 var method = this.member; | 14577 var method = this.member; |
| 14602 if (method.needsArgumentConversion(args)) { | 14578 if (method.needsArgumentConversion(args)) { |
| 14603 return false; | 14579 return false; |
| 14604 } | 14580 } |
| 14605 for (var i = args.get$length(); | 14581 for (var i = args.get$length(); |
| 14606 i < method.parameters.get$length(); i++) { | 14582 i < method.parameters.get$length(); i++) { |
| 14607 if ($ne(method.parameters[i].get$value().get$code(), "null")) { | 14583 if ($ne(method.parameters.$index(i).get$value().get$code(), "null")) { |
| 14608 return false; | 14584 return false; |
| 14609 } | 14585 } |
| 14610 } | 14586 } |
| 14611 return method.namesInHomePositions(args); | 14587 return method.namesInHomePositions(args); |
| 14612 } | 14588 } |
| 14613 else { | 14589 else { |
| 14614 return false; | 14590 return false; |
| 14615 } | 14591 } |
| 14616 } | 14592 } |
| 14617 VarMethodStub.prototype.generate$1 = VarMethodStub.prototype.generate; | 14593 VarMethodStub.prototype.generate$1 = VarMethodStub.prototype.generate; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 14630 VarMethodSet.prototype.invoke = function(context, node, target, args) { | 14606 VarMethodSet.prototype.invoke = function(context, node, target, args) { |
| 14631 this._invokeMembers(context, node); | 14607 this._invokeMembers(context, node); |
| 14632 return VarMember.prototype.invoke.call(this, context, node, target, args); | 14608 return VarMember.prototype.invoke.call(this, context, node, target, args); |
| 14633 } | 14609 } |
| 14634 VarMethodSet.prototype._invokeMembers = function(context, node) { | 14610 VarMethodSet.prototype._invokeMembers = function(context, node) { |
| 14635 if (this.invoked) return; | 14611 if (this.invoked) return; |
| 14636 this.invoked = true; | 14612 this.invoked = true; |
| 14637 var hasObjectType = false; | 14613 var hasObjectType = false; |
| 14638 var $$list = this.members; | 14614 var $$list = this.members; |
| 14639 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { | 14615 for (var $$i = 0;$$i < $$list.get$length(); $$i++) { |
| 14640 var member = $$list[$$i]; | 14616 var member = $$list.$index($$i); |
| 14641 var type = member.get$declaringType(); | 14617 var type = member.get$declaringType(); |
| 14642 var target = new Value(type, "this", node.span); | 14618 var target = new Value(type, "this", node.span); |
| 14643 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru
e); | 14619 var result = member.invoke$4$isDynamic(context, node, target, this.args, tru
e); |
| 14644 var stub = new VarMethodStub(this.name, member, this.args, "return " + resul
t.get$code()); | 14620 var stub = new VarMethodStub(this.name, member, this.args, "return " + resul
t.get$code()); |
| 14645 type.get$varStubs().$setindex(stub.get$name(), stub); | 14621 type.get$varStubs().$setindex(stub.get$name(), stub); |
| 14646 if (type.get$isObject()) hasObjectType = true; | 14622 if (type.get$isObject()) hasObjectType = true; |
| 14647 } | 14623 } |
| 14648 if (!hasObjectType) { | 14624 if (!hasObjectType) { |
| 14649 var target = new Value($globals.world.objectType, "this", node.span); | 14625 var target = new Value($globals.world.objectType, "this", node.span); |
| 14650 var result = target.invokeNoSuchMethod$4(context, this.baseName, node, this.
args); | 14626 var result = target.invokeNoSuchMethod$4(context, this.baseName, node, this.
args); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 14661 function _otherOperator(jsname, op) { | 14637 function _otherOperator(jsname, op) { |
| 14662 return ("function " + jsname + "(x, y) {\n return (typeof(x) == 'number' && t
ypeof(y) == 'number')\n ? x " + op + " y : x." + jsname + "(y);\n}"); | 14638 return ("function " + jsname + "(x, y) {\n return (typeof(x) == 'number' && t
ypeof(y) == 'number')\n ? x " + op + " y : x." + jsname + "(y);\n}"); |
| 14663 } | 14639 } |
| 14664 function map(source, mapper) { | 14640 function map(source, mapper) { |
| 14665 var result = new Array(); | 14641 var result = new Array(); |
| 14666 if (!!(source && source.is$List())) { | 14642 if (!!(source && source.is$List())) { |
| 14667 var list = source; | 14643 var list = source; |
| 14668 result.set$length(list.get$length()); | 14644 result.set$length(list.get$length()); |
| 14669 for (var i = (0); | 14645 for (var i = (0); |
| 14670 i < list.get$length(); i++) { | 14646 i < list.get$length(); i++) { |
| 14671 result.$setindex(i, mapper.call$1(list[i])); | 14647 result.$setindex(i, mapper(list.$index(i))); |
| 14672 } | 14648 } |
| 14673 } | 14649 } |
| 14674 else { | 14650 else { |
| 14675 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { | 14651 for (var $$i = source.iterator$0(); $$i.hasNext$0(); ) { |
| 14676 var item = $$i.next$0(); | 14652 var item = $$i.next$0(); |
| 14677 result.add(mapper.call$1(item)); | 14653 result.add(mapper(item)); |
| 14678 } | 14654 } |
| 14679 } | 14655 } |
| 14680 return result; | 14656 return result; |
| 14681 } | 14657 } |
| 14682 function reduce(source, callback, initialValue) { | 14658 function reduce(source, callback, initialValue) { |
| 14683 var i = source.iterator$0(); | 14659 var i = source.iterator$0(); |
| 14684 var current = initialValue; | 14660 var current = initialValue; |
| 14685 if (current == null && i.hasNext$0()) { | 14661 if (current == null && i.hasNext$0()) { |
| 14686 current = i.next$0(); | 14662 current = i.next$0(); |
| 14687 } | 14663 } |
| 14688 while (i.hasNext$0()) { | 14664 while (i.hasNext$0()) { |
| 14689 current = callback.call$2(current, i.next$0()); | 14665 current = callback.call$2(current, i.next$0()); |
| 14690 } | 14666 } |
| 14691 return current; | 14667 return current; |
| 14692 } | 14668 } |
| 14693 function orderValuesByKeys(map) { | 14669 function orderValuesByKeys(map) { |
| 14694 var keys = map.getKeys(); | 14670 var keys = map.getKeys(); |
| 14695 keys.sort((function (x, y) { | 14671 keys.sort((function (x, y) { |
| 14696 return x.compareTo$1(y); | 14672 return x.compareTo$1(y); |
| 14697 }) | 14673 }) |
| 14698 ); | 14674 ); |
| 14699 var values = []; | 14675 var values = []; |
| 14700 for (var $$i = 0;$$i < keys.get$length(); $$i++) { | 14676 for (var $$i = 0;$$i < keys.get$length(); $$i++) { |
| 14701 var k = keys[$$i]; | 14677 var k = keys.$index($$i); |
| 14702 values.add$1(map.$index(k)); | 14678 values.add$1(map.$index(k)); |
| 14703 } | 14679 } |
| 14704 return values; | 14680 return values; |
| 14705 } | 14681 } |
| 14706 var world; | 14682 var world; |
| 14707 var experimentalAwaitPhase; | 14683 var experimentalAwaitPhase; |
| 14708 var legCompile; | 14684 var legCompile; |
| 14709 function initializeWorld(files) { | 14685 function initializeWorld(files) { |
| 14710 $globals.world = new World(files); | 14686 $globals.world = new World(files); |
| 14711 $globals.world.init(); | 14687 $globals.world.init(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 14728 if (name0.contains$1("$")) { | 14704 if (name0.contains$1("$")) { |
| 14729 nameBuilder.add$1(("" + name0.get$length())); | 14705 nameBuilder.add$1(("" + name0.get$length())); |
| 14730 } | 14706 } |
| 14731 nameBuilder.add$1(name0); | 14707 nameBuilder.add$1(name0); |
| 14732 } | 14708 } |
| 14733 return nameBuilder.toString$0(); | 14709 return nameBuilder.toString$0(); |
| 14734 } | 14710 } |
| 14735 // ********** Library minfrog ************** | 14711 // ********** Library minfrog ************** |
| 14736 // ********** Code for top level ************** | 14712 // ********** Code for top level ************** |
| 14737 function main() { | 14713 function main() { |
| 14738 var homedir = path.dirname(fs.realpathSync(get$process().get$argv()[(1)])); | 14714 var homedir = path.dirname(fs.realpathSync(get$process().get$argv().$index((1)
))); |
| 14739 var argv = []; | 14715 var argv = []; |
| 14740 for (var i = (0); | 14716 for (var i = (0); |
| 14741 i < get$process().get$argv().get$length(); i++) { | 14717 i < get$process().get$argv().get$length(); i++) { |
| 14742 argv.add$1(get$process().get$argv()[i]); | 14718 argv.add$1(get$process().get$argv().$index(i)); |
| 14743 if (i == (1)) { | 14719 if (i == (1)) { |
| 14744 var terminal = get$process().get$env().$index("TERM"); | 14720 var terminal = get$process().get$env().$index("TERM"); |
| 14745 if (terminal == null || !terminal.startsWith$1("xterm")) { | 14721 if (terminal == null || !terminal.startsWith$1("xterm")) { |
| 14746 argv.add$1("--no_colors"); | 14722 argv.add$1("--no_colors"); |
| 14747 } | 14723 } |
| 14748 } | 14724 } |
| 14749 } | 14725 } |
| 14750 if (compile(homedir, argv, new NodeFileSystem())) { | 14726 if (compile(homedir, argv, new NodeFileSystem())) { |
| 14751 var code = $globals.world.getGeneratedCode(); | 14727 var code = $globals.world.getGeneratedCode(); |
| 14752 if ($globals.options.compileOnly) { | 14728 if ($globals.options.compileOnly) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14791 $globals._RED_COLOR = "\x1b[31m"; | 14767 $globals._RED_COLOR = "\x1b[31m"; |
| 14792 } | 14768 } |
| 14793 var const$0000 = Object.create(EmptyQueueException.prototype, {}); | 14769 var const$0000 = Object.create(EmptyQueueException.prototype, {}); |
| 14794 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); | 14770 var const$0001 = Object.create(_DeletedKeySentinel.prototype, {}); |
| 14795 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); | 14771 var const$0005 = Object.create(NoMoreElementsException.prototype, {}); |
| 14796 var const$0007 = Object.create(IllegalAccessException.prototype, {}); | 14772 var const$0007 = Object.create(IllegalAccessException.prototype, {}); |
| 14797 var const$0008 = ImmutableList.ImmutableList$from$factory([]); | 14773 var const$0008 = ImmutableList.ImmutableList$from$factory([]); |
| 14798 var $globals = {}; | 14774 var $globals = {}; |
| 14799 $static_init(); | 14775 $static_init(); |
| 14800 main(); | 14776 main(); |
| OLD | NEW |